Make changes to allow for split nets on pt to pt interfaces.
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1985 06:57:48 +0000 (22:57 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Thu, 21 Nov 1985 06:57:48 +0000 (22:57 -0800)
SCCS-vsn: sbin/XNSrouted/input.c 5.5
SCCS-vsn: sbin/XNSrouted/output.c 5.4

usr/src/sbin/XNSrouted/input.c
usr/src/sbin/XNSrouted/output.c

index e00be4a..5112f81 100644 (file)
@@ -9,7 +9,7 @@
 
 
 #ifndef lint
 
 
 #ifndef lint
-static char sccsid[] = "@(#)input.c    5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)input.c    5.5 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -134,7 +134,7 @@ rip_input(from, size)
                        struct sockaddr *sa;
                        if (size < sizeof (struct netinfo))
                                break;
                        struct sockaddr *sa;
                        if (size < sizeof (struct netinfo))
                                break;
-                       if ((unsigned) ntohs(n->rip_metric) > HOPCNT_INFINITY)
+                       if ((unsigned) ntohs(n->rip_metric) >= HOPCNT_INFINITY)
                                continue;
                        rt = rtfind(sa = xns_nettosa(n->rip_dst));
                        if (rt == 0) {
                                continue;
                        rt = rtfind(sa = xns_nettosa(n->rip_dst));
                        if (rt == 0) {
index d4b0e6f..363d971 100644 (file)
@@ -1,5 +1,14 @@
+/*
+ * Copyright (c) 1985 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * Includes material written at Cornell University by Bill Nesheim,
+ * by permission of the author.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)output.c   4.5 (Berkeley) 4/9/84";
+static char sccsid[] = "@(#)output.c   5.4 (Berkeley) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -77,6 +86,8 @@ again:
                        n = msg->rip_nets;
                }
                sns = (struct sockaddr_ns *)&rt->rt_dst;
                        n = msg->rip_nets;
                }
                sns = (struct sockaddr_ns *)&rt->rt_dst;
+               if ((rt->rt_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST)
+                       sns = (struct sockaddr_ns *)&rt->rt_router;
                metric = min(rt->rt_metric + 1, HOPCNT_INFINITY);
                net = ns_netof(sns->sns_addr);
                /*
                metric = min(rt->rt_metric + 1, HOPCNT_INFINITY);
                net = ns_netof(sns->sns_addr);
                /*