summaryrefslogtreecommitdiff
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-12 15:24:46 +0200
commit8cfc9c5b3a6051c20f28c9dc01d5ee7264467851 (patch)
tree7d7e8b5a6f625f08bb274948646ba81d6d5021b6
parentb4d130923622dca9592c67f3f580af0ff5aaf342 (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>
-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;
}