diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 22284fd28d..cba3811e11 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1078,8 +1078,8 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, continue; api_nh = &api.nexthops[valid_nh_count]; - api_nh->vrf_id = bgp->vrf_id; - + api_nh->vrf_id = nh_othervrf ? info->extra->bgp_orig->vrf_id + : bgp->vrf_id; if (nh_family == AF_INET) { struct in_addr *nexthop; @@ -1129,11 +1129,8 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, } nexthop = &mpinfo_cp->attr->nexthop; - api_nh->gate.ipv4 = *nexthop; - api_nh->vrf_id = nh_othervrf - ? info->extra->bgp_orig->vrf_id - : bgp->vrf_id; + /* EVPN type-2 routes are programmed as onlink on l3-vni SVI */ @@ -1206,9 +1203,6 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p, api_nh->gate.ipv6 = *nexthop; api_nh->ifindex = ifindex; api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX; - /* api_nh->vrf_id is not set for normal case? */ - if (nh_othervrf) - api_nh->vrf_id = info->extra->bgp_orig->vrf_id; } if (mpinfo->extra