diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2019-05-25 11:43:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-25 11:43:10 +0200 |
| commit | d78978e49f090139bfa5cb77a5e07ecd7953f7d9 (patch) | |
| tree | 3da22f3f2e6ce2f5bf58d576a395c99f3c192d48 /zebra/zebra_rib.c | |
| parent | fa468cd94655d0cd2aba0e790cb1d308d4148f57 (diff) | |
| parent | 33656d2db287fd293be0cfc59885e2b8ebc2ecad (diff) | |
zebra: Add kernel level graceful restart (#4301)
zebra: Add kernel level graceful restart
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 8f27316669..391917ec68 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3127,6 +3127,7 @@ void rib_sweep_table(struct route_table *table) for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) { RNODE_FOREACH_RE_SAFE (rn, re, next) { + if (IS_ZEBRA_DEBUG_RIB) route_entry_dump(&rn->p, NULL, re); @@ -3137,6 +3138,14 @@ void rib_sweep_table(struct route_table *table) continue; /* + * If routes are older than startup_time then + * we know we read them in from the kernel. + * As such we can safely remove them. + */ + if (zrouter.startup_time < re->uptime) + continue; + + /* * So we are starting up and have received * routes from the kernel that we have installed * from a previous run of zebra but not cleaned @@ -3165,7 +3174,7 @@ void rib_sweep_table(struct route_table *table) } /* Sweep all RIB tables. */ -void rib_sweep_route(void) +int rib_sweep_route(struct thread *t) { struct vrf *vrf; struct zebra_vrf *zvrf; @@ -3179,6 +3188,8 @@ void rib_sweep_route(void) } zebra_router_sweep_route(); + + return 0; } /* Remove specific by protocol routes from 'table'. */ |
