mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-25 20:38:34 +00:00
Merge pull request #4402 from chiragshah6/evpn_dev1
bgpd: fix debug to have proper nhop display
This commit is contained in:
commit
fc37d4fe0d
@ -2472,7 +2472,7 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
|
|||||||
|
|
||||||
if (bgp_debug_zebra(NULL)) {
|
if (bgp_debug_zebra(NULL)) {
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"installing evpn prefix %s as ip prefix %s in vrf %s",
|
"import evpn prefix %s as ip prefix %s in vrf %s",
|
||||||
prefix2str(evp, buf, sizeof(buf)),
|
prefix2str(evp, buf, sizeof(buf)),
|
||||||
prefix2str(pp, buf1, sizeof(buf)),
|
prefix2str(pp, buf1, sizeof(buf)),
|
||||||
vrf_id_to_name(bgp_vrf->vrf_id));
|
vrf_id_to_name(bgp_vrf->vrf_id));
|
||||||
|
@ -1435,15 +1435,29 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
|||||||
for (i = 0; i < api.nexthop_num; i++) {
|
for (i = 0; i < api.nexthop_num; i++) {
|
||||||
api_nh = &api.nexthops[i];
|
api_nh = &api.nexthops[i];
|
||||||
|
|
||||||
if (api_nh->type == NEXTHOP_TYPE_IFINDEX)
|
switch (api_nh->type) {
|
||||||
|
case NEXTHOP_TYPE_IFINDEX:
|
||||||
nh_buf[0] = '\0';
|
nh_buf[0] = '\0';
|
||||||
else {
|
break;
|
||||||
if (api_nh->type == NEXTHOP_TYPE_IPV4)
|
case NEXTHOP_TYPE_IPV4:
|
||||||
nh_family = AF_INET;
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
||||||
else
|
nh_family = AF_INET;
|
||||||
nh_family = AF_INET6;
|
|
||||||
inet_ntop(nh_family, &api_nh->gate, nh_buf,
|
inet_ntop(nh_family, &api_nh->gate, nh_buf,
|
||||||
sizeof(nh_buf));
|
sizeof(nh_buf));
|
||||||
|
break;
|
||||||
|
case NEXTHOP_TYPE_IPV6:
|
||||||
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||||
|
nh_family = AF_INET6;
|
||||||
|
inet_ntop(nh_family, &api_nh->gate, nh_buf,
|
||||||
|
sizeof(nh_buf));
|
||||||
|
break;
|
||||||
|
case NEXTHOP_TYPE_BLACKHOLE:
|
||||||
|
strlcpy(nh_buf, "blackhole", sizeof(nh_buf));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Note: add new nexthop case */
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
label_buf[0] = '\0';
|
label_buf[0] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user