notice failed opens other than timeout
[unix-history] / usr / src / sys / net / route.c
index 7022730..9b44703 100644 (file)
@@ -1,4 +1,4 @@
-/*     route.c 4.21    83/06/12        */
+/*     route.c 6.1     83/07/29        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -125,11 +125,16 @@ rtredirect(dst, gateway)
        rtalloc(&ro);
        rt = ro.ro_rt;
        /*
        rtalloc(&ro);
        rt = ro.ro_rt;
        /*
-        * Create a new entry if the lookup failed.
-        * This is necessary for hosts which use routing
-        * redirects generated by smart gateways to dynamically
-        * build the routing tables.
+        * Create a new entry if we just got back a wildcard entry
+        * or the the lookup failed.  This is necessary for hosts
+        * which use routing redirects generated by smart gateways
+        * to dynamically build the routing tables.
         */
         */
+       if (rt &&
+           (*afswitch[dst->sa_family].af_netmatch)(&wildcard, &rt->rt_dst)) {
+               rtfree(rt);
+               rt = 0;
+       }
        if (rt == 0) {
                rtinit(dst, gateway, RTF_GATEWAY);
                rtstat.rts_dynamic++;
        if (rt == 0) {
                rtinit(dst, gateway, RTF_GATEWAY);
                rtstat.rts_dynamic++;