]> git.proxmox.com Git - mirror_frr.git/blobdiff - staticd/static_routes.c
Merge pull request #5327 from lkrishnamoor/rm_rd_filter
[mirror_frr.git] / staticd / static_routes.c
index 34f58a98e23ff8d6b63aad239c8623a9f7d6b7c5..e8d6a4289b971f3c6b6f97b310d9370fe537549f 100644 (file)
@@ -100,7 +100,8 @@ int static_add_route(afi_t afi, safi_t safi, uint8_t type, struct prefix *p,
                             && IPV4_ADDR_SAME(&gate->ipv4, &si->addr.ipv4))
                            || (afi == AFI_IP6
                                && IPV6_ADDR_SAME(gate, &si->addr.ipv6))))
-                   && (!strcmp(ifname ? ifname : "", si->ifname))) {
+                   && (!strcmp(ifname ? ifname : "", si->ifname))
+                   && nh_svrf->vrf->vrf_id == si->nh_vrf_id) {
                        if ((distance == si->distance) && (tag == si->tag)
                            && (table_id == si->table_id)
                            && !memcmp(&si->snh_label, snh_label,
@@ -309,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;
                                }