diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index cd1873054e..f7c4b04adf 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1347,11 +1347,21 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, nexthop = bgp_path_info_to_ipv6_nexthop(mpinfo_cp, &ifindex); - nh_updated = update_ipv6nh_for_route_install( - nh_othervrf, nh_othervrf ? - info->extra->bgp_orig : bgp, - nexthop, ifindex, - mpinfo, info, is_evpn, api_nh); + + if (!nexthop) + nh_updated = update_ipv4nh_for_route_install( + nh_othervrf, + nh_othervrf ? info->extra->bgp_orig + : bgp, + &mpinfo_cp->attr->nexthop, + mpinfo_cp->attr, is_evpn, api_nh); + else + nh_updated = update_ipv6nh_for_route_install( + nh_othervrf, + nh_othervrf ? info->extra->bgp_orig + : bgp, + nexthop, ifindex, mpinfo, info, is_evpn, + api_nh); } /* Did we get proper nexthop info to update zebra? */