From 9eb8b14c857f1ce45edd084f61a872e376f3184b Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 23 Oct 2019 16:53:09 +0200 Subject: [PATCH] staticd: check tuple (vrf, name) when interface events received with network namespace vrf backend, there is possibilities that the same interface name can be used across two different vrfs. Then, enforce the check when static daemon receives interface events. Adding to the interface name, check for the vrf id, too. Signed-off-by: Philippe Guibert --- staticd/static_routes.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staticd/static_routes.c b/staticd/static_routes.c index a8a5ca523a..e8d6a4289b 100644 --- a/staticd/static_routes.c +++ b/staticd/static_routes.c @@ -310,10 +310,14 @@ static void static_ifindex_update_af(struct interface *ifp, bool up, afi_t afi, if (up) { if (strcmp(si->ifname, ifp->name)) continue; + if (si->nh_vrf_id != ifp->vrf_id) + continue; si->ifindex = ifp->ifindex; } else { if (si->ifindex != ifp->ifindex) continue; + if (si->nh_vrf_id != ifp->vrf_id) + continue; si->ifindex = IFINDEX_INTERNAL; }