summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-05-04 09:43:52 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-05-04 16:50:47 +0200
commit393ec5424e35d1469d6a3c9ac7cd0f38481bb359 (patch)
tree9620e7edfdcc563d7a7c6c5816e31063ae61e535 /zebra/interface.c
parent5efbf310549f60de33946d0de3399d5586f6896a (diff)
zebra: fix missing node attribute set in ifp
There are cases when switching from one netns to an other one, where the if_table registration by index has not been flushed. This fix mitigates the potential crashes, in case the ifp->node pointer is null, the value is overwritten by the route_node obtained. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 6f59a2d399..fc44be34ea 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -202,6 +202,7 @@ struct interface *if_link_per_ns(struct zebra_ns *ns, struct interface *ifp)
if (rn->info) {
ifp = (struct interface *)rn->info;
route_unlock_node(rn); /* get */
+ ifp->node = rn;
return ifp;
}