summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2010-04-14 11:05:27 +0200
committerGreg Troxel <gdt@ir.bbn.com>2010-04-18 14:35:36 -0400
commit274d3f090df91fc5f8d4f26a2823634efa4af461 (patch)
treebcdbc9bc1eea38e2441d0c53152325e41940b122 /ospfd
parent515b9424d4106ff5ccef4f18030a3ca69d38a178 (diff)
ospfd: Make sure all external routes are updated.
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>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_zebra.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 6f0a71ff..90bee215 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -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;
}