]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: check tuple (vrf, name) when interface events received
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 23 Oct 2019 14:53:09 +0000 (16:53 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 23 Oct 2019 16:50:56 +0000 (18:50 +0200)
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 <philippe.guibert@6wind.com>
staticd/static_routes.c

index a8a5ca523a279e0f12061317696157794825994a..e8d6a4289b971f3c6b6f97b310d9370fe537549f 100644 (file)
@@ -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;
                                }