summaryrefslogtreecommitdiff
path: root/zebra/if_netlink.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-05-04 09:26:10 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-05-04 16:50:47 +0200
commit5efbf310549f60de33946d0de3399d5586f6896a (patch)
treeb5bf9b668b850c5fbb8ec802e483f89d93e8fb87 /zebra/if_netlink.c
parent9373219c67e1e4538d49f9a5f6398d38de6d862f (diff)
zebra: avoid case where same interface pointer returned
When checking for a duplicate interface in an other NETNS, one may find an interface in default VRF. That interface may have been moved to that default VRF, for further action. Prevent from doing any action at this point. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r--zebra/if_netlink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index beac8ffedb..7423e9237f 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -1040,6 +1040,12 @@ static void if_netlink_check_ifp_instance_consistency(uint16_t cmd,
other_ifp = if_lookup_by_name_not_ns(ns_id, ifp->name);
if (!other_ifp)
return;
+ /* because previous interface may be inactive,
+ * interface is moved back to default vrf
+ * then one may find the same pointer; ignore
+ */
+ if (other_ifp == ifp)
+ return;
if ((cmd == RTM_NEWLINK)
&& (CHECK_FLAG(other_ifp->status, ZEBRA_INTERFACE_ACTIVE)))
return;