want to act as supplier if we have only a single point-point link;
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1985 06:37:57 +0000 (22:37 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1985 06:37:57 +0000 (22:37 -0800)
can't run timer on any interfaces if not a supplier

SCCS-vsn: sbin/routed/startup.c 5.2
SCCS-vsn: sbin/routed/timer.c 5.3

usr/src/sbin/routed/startup.c
usr/src/sbin/routed/timer.c

index 3fe20c1..55688d1 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)startup.c  5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)startup.c  5.2 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -119,6 +119,14 @@ ifinit()
                if ((ifs.int_flags & IFF_POINTOPOINT) == 0 ||
                    if_ifwithaddr(&ifs.int_dstaddr) == 0)
                        externalinterfaces++;
                if ((ifs.int_flags & IFF_POINTOPOINT) == 0 ||
                    if_ifwithaddr(&ifs.int_dstaddr) == 0)
                        externalinterfaces++;
+               /*
+                * If we have a point-to-point link, we want to act
+                * as a supplier even if it's our only interface,
+                * as that's the only way our peer on the other end
+                * can tell that the link is up.
+                */
+               if ((ifs.int_flags & IFF_POINTOPOINT) && supplier < 0)
+                       supplier = 1;
                ifp->int_name = malloc(strlen(ifr->ifr_name) + 1);
                if (ifp->int_name == 0) {
                        fprintf(stderr, "routed: ifinit: out of memory\n");
                ifp->int_name = malloc(strlen(ifr->ifr_name) + 1);
                if (ifp->int_name == 0) {
                        fprintf(stderr, "routed: ifinit: out of memory\n");
index a776cef..558cad9 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)timer.c    5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)timer.c    5.3 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -37,17 +37,11 @@ again:
                for (; rt != (struct rt_entry *)rh; rt = rt->rt_forw) {
                        /*
                         * We don't advance time on a routing entry for
                for (; rt != (struct rt_entry *)rh; rt = rt->rt_forw) {
                        /*
                         * We don't advance time on a routing entry for
-                        * a passive gateway or that for our only interface. 
-                        * The latter is excused because we don't act as
-                        * a routing information supplier and hence would
-                        * time it out.  This is fair as if it's down
-                        * we're cut off from the world anyway and it's
-                        * not likely we'll grow any new hardware in
-                        * the mean time.
+                        * a passive gateway, or any interface if we're
+                        * not acting as supplier.
                         */
                        if (!(rt->rt_state & RTS_PASSIVE) &&
                         */
                        if (!(rt->rt_state & RTS_PASSIVE) &&
-                           (externalinterfaces > 1 ||
-                           !(rt->rt_state & RTS_INTERFACE)))
+                           (supplier || !(rt->rt_state & RTS_INTERFACE)))
                                rt->rt_timer += TIMER_RATE;
                        if (rt->rt_timer >= EXPIRE_TIME)
                                rt->rt_metric = HOPCNT_INFINITY;
                                rt->rt_timer += TIMER_RATE;
                        if (rt->rt_timer >= EXPIRE_TIME)
                                rt->rt_metric = HOPCNT_INFINITY;