diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-29 12:02:47 +0200 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-30 08:05:01 +0200 |
| commit | 357b150daec44c3309391cae921f0a284d171b43 (patch) | |
| tree | 401d6ea133cfd7315c78d0d2f149768238996970 /zebra/interface.c | |
| parent | ecffe9167b1debd0c7e3a632e5b1a5e834bb4ebe (diff) | |
zebra: at startup, fix links on all namespaces
when zebra has vrf backend mapped to namespaces, the polling
of interfaces leads to fix all linkages of interfaces. This
was not done on non default namespace. do it for other namespaces.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 4b708496a1..a3134d6647 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1148,18 +1148,16 @@ void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, * during initial link dump kernel does not order lower devices before * upper devices so we need to fixup link dependencies at the end of dump */ -void zebra_if_update_all_links(void) +void zebra_if_update_all_links(struct zebra_ns *zns) { struct route_node *rn; struct interface *ifp; struct zebra_if *zif; - struct zebra_ns *ns; if (IS_ZEBRA_DEBUG_KERNEL) zlog_info("fixup link dependencies"); - ns = zebra_ns_lookup(NS_DEFAULT); - for (rn = route_top(ns->if_table); rn; rn = route_next(rn)) { + for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { ifp = (struct interface *)rn->info; if (!ifp) continue; @@ -1177,8 +1175,8 @@ void zebra_if_update_all_links(void) /* update SVI linkages */ if ((zif->link_ifindex != IFINDEX_INTERNAL) && !zif->link) { - zif->link = if_lookup_by_index_per_ns(ns, - zif->link_ifindex); + zif->link = if_lookup_by_index_per_ns( + zns, zif->link_ifindex); if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("interface %s/%d's lower fixup to %s/%d", ifp->name, ifp->ifindex, |
