]> git.proxmox.com Git - mirror_frr.git/commitdiff
Ignore host routes to self.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Wed, 20 Aug 2008 12:24:39 +0000 (14:24 +0200)
committerJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 25 Aug 2008 07:50:17 +0000 (09:50 +0200)
PtP links with /32 masks adds host routes to the remote host,
see RFC 2328, 12.4.1.1, Option 1.
Make sure that such routes are ignored

ospfd/ospf_spf.c

index 23d45dd63db755ee0c39e4b3b69fa69464df366c..15d27be7fd4fb8bc3fb73c53a9c30f73a1676d39 100644 (file)
@@ -981,7 +981,21 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
                 (l->m[0].tos_count * ROUTER_LSA_TOS_SIZE));
 
           if (l->m[0].type == LSA_LINK_TYPE_STUB)
-            ospf_intra_add_stub (rt, l, v, area);
+           {
+             /* PtP links with /32 masks adds host routes to the remote host,
+                see RFC 2328, 12.4.1.1, Option 1.
+                Make sure that such routes are ignored */
+             /* XXX: Change to breadth-first and avoid the lookup */
+             if (l->link_data.s_addr == 0xffffffff &&
+                 ospf_if_lookup_by_local_addr (area->ospf, NULL, l->link_id))
+               {
+                 if (IS_DEBUG_OSPF_EVENT)
+                   zlog_debug ("ospf_spf_process_stubs(): ignoring host route "
+                               "%s/32 to self.", inet_ntoa (l->link_id));
+                 continue;
+               }
+             ospf_intra_add_stub (rt, l, v, area);
+           }
         }
     }