diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2017-12-08 19:06:34 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-27 11:11:24 +0100 |
| commit | fe533c564e1901ee6b767708345abb52a56056af (patch) | |
| tree | 6837eb93d5e7e0ea4edf93286e4cf785c94a2868 /zebra/interface.c | |
| parent | c17d483845c4b772270cade18f2ce5a5e14bc14e (diff) | |
zebra: socket operations stick to namespace if necessary
Upon following calls: interface poll, address poll, route poll, and
ICMPv6 handling, each new Namespace is being parsed. For that, the
socket operations need to switch from one NS to one other, to get the
necessary information.
As of now, there is a crash when dumping interfaces, through show
running-config.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 07570e64bf..6ee1db6a4c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -512,8 +512,13 @@ static void if_addr_wakeup(struct interface *ifp) void if_add_update(struct interface *ifp) { struct zebra_if *if_data; + struct zebra_ns *zns; - if_link_per_ns(zebra_ns_lookup(NS_DEFAULT), ifp); + if (vrf_is_backend_netns()) + zns = zebra_ns_lookup((ns_id_t)ifp->vrf_id); + else + zns = zebra_ns_lookup(NS_DEFAULT); + if_link_per_ns(zns, ifp); if_data = ifp->info; assert(if_data); |
