&& 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,
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;
}