diff options
| author | Russ White <russ@riw.us> | 2021-01-12 07:32:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-12 07:32:19 -0500 |
| commit | 7fbdb03103e94e35d0a10f2e035d70e69bec84c3 (patch) | |
| tree | 281b6a0c86e0d24784315ab75cbf76ec267efb68 | |
| parent | aa6fdabb7323407ffcd95a51e617cb0d1791443a (diff) | |
| parent | 00c106648fe5bf0f15f1fab4a133c7e053a0bceb (diff) | |
Merge pull request #7670 from ton31337/fix/bgpd_nexhop_handling_for_zebra
bgpd: Handle IPv6 prefixes with IPv4 nexthops for zebra
| -rw-r--r-- | bgpd/bgp_zebra.c | 20 |
1 files changed, 15 insertions, 5 deletions
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? */ |
