]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Make sure all external routes are updated.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Wed, 14 Apr 2010 09:05:27 +0000 (11:05 +0200)
committerGreg Troxel <gdt@ir.bbn.com>
Sun, 18 Apr 2010 18:35:36 +0000 (14:35 -0400)
Roman Hoog Antink <rha@open.ch> reports:

When adding a connected route (using vtysh, without restart) to the
redistribution access list of ospfd, while static routes already exist,
the update timer ospf_distribute_list_update_timer() is being run for
static routes only. That way, the connected route never appears in the
OSPF database, until quagga is completely restarted.

The update timer for connected routes is cancelled in
ospfd/ospfd_zebra.c:ospf_distribute_list_update():976, were a new timer
is scheduled for static routes, caused by the loop in ospf_filter_update().

 * ospf_zebra.c: (ospf_distribute_list_update_timer) make it
   refresh all external routes. This fixes the problem
   reported by Roman.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
ospfd/ospf_zebra.c

index 6f0a71ff51cc903fe0e341fd99c14f29991c8eff..90bee21513a55c38928c279639f80412663f9bae 100644 (file)
@@ -929,14 +929,9 @@ ospf_distribute_list_update_timer (struct thread *thread)
   struct external_info *ei;
   struct route_table *rt;
   struct ospf_lsa *lsa;
-  intptr_t type;
+  int type;
   struct ospf *ospf;
 
-  type = (intptr_t)THREAD_ARG (thread);
-  assert (type <= ZEBRA_ROUTE_MAX);
-  
-  rt = EXTERNAL_INFO (type);
-
   ospf = ospf_lookup ();
   if (ospf == NULL)
     return 0;
@@ -946,17 +941,22 @@ ospf_distribute_list_update_timer (struct thread *thread)
   zlog_info ("Zebra[Redistribute]: distribute-list update timer fired!");
 
   /* foreach all external info. */
-  if (rt)
-    for (rn = route_top (rt); rn; rn = route_next (rn))
-      if ((ei = rn->info) != NULL)
-        {
-          if (is_prefix_default (&ei->p))
-            ospf_external_lsa_refresh_default (ospf);
-          else if ((lsa = ospf_external_info_find_lsa (ospf, &ei->p)))
-            ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_IF_CHANGED);
-          else
-            ospf_external_lsa_originate (ospf, ei);
-        }
+  for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
+    {
+      rt = EXTERNAL_INFO (type);
+      if (!rt)
+       continue;
+      for (rn = route_top (rt); rn; rn = route_next (rn))
+       if ((ei = rn->info) != NULL)
+         {
+           if (is_prefix_default (&ei->p))
+             ospf_external_lsa_refresh_default (ospf);
+           else if ((lsa = ospf_external_info_find_lsa (ospf, &ei->p)))
+             ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_IF_CHANGED);
+           else
+             ospf_external_lsa_originate (ospf, ei);
+         }
+    }
   return 0;
 }