]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix missing node attribute set in ifp
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 4 May 2018 07:43:52 +0000 (09:43 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 4 May 2018 14:50:47 +0000 (16:50 +0200)
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>
zebra/interface.c

index 6f59a2d399632d551a8c9f4fda8935877c80cc0e..fc44be34ea88eccbc1e80d9e3e922e409987b6dd 100644 (file)
@@ -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;
        }