]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Tighten up the connected check for redistribution
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Fri, 7 Aug 2009 11:48:15 +0000 (13:48 +0200)
committerPaul Jakma <paul@quagga.net>
Fri, 28 Aug 2009 11:29:38 +0000 (12:29 +0100)
* ospf_zebra.c: (ospf_distribute_check_connected) check to make filter out
  routes matching connected routes was matching against OSPF networks, which
  can be far more general than the actual connected interfaces. Fix.

ospfd/ospf_zebra.c

index 52b23fe83f6db74f4b67d2fe605f2afd693b00ca..6f0a71ff51cc903fe0e341fd99c14f29991c8eff 100644 (file)
@@ -682,16 +682,13 @@ ospf_external_lsa_originate_check (struct ospf *ospf,
 int
 ospf_distribute_check_connected (struct ospf *ospf, struct external_info *ei)
 {
-  struct route_node *rn;
+  struct listnode *node;
+  struct ospf_interface *oi;
 
-  for (rn = route_top (ospf->networks); rn; rn = route_next (rn))
-    if (rn->info != NULL)
-      if (prefix_match (&rn->p, (struct prefix *) &ei->p))
-        {
-          route_unlock_node (rn);
-          return 0;
-        }
 
+  for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
+      if (prefix_match (oi->address, (struct prefix *) &ei->p))
+          return 0;
   return 1;
 }