Merge pull request #4402 from chiragshah6/evpn_dev1

bgpd: fix debug to have proper nhop display
This commit is contained in:
Sri Mohana Singamsetty 2019-05-29 12:44:41 -07:00 committed by GitHub
commit fc37d4fe0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View File

@ -2472,7 +2472,7 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
if (bgp_debug_zebra(NULL)) {
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(pp, buf1, sizeof(buf)),
vrf_id_to_name(bgp_vrf->vrf_id));

View File

@ -1435,15 +1435,29 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
for (i = 0; i < api.nexthop_num; 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';
else {
if (api_nh->type == NEXTHOP_TYPE_IPV4)
nh_family = AF_INET;
else
nh_family = AF_INET6;
break;
case NEXTHOP_TYPE_IPV4:
case NEXTHOP_TYPE_IPV4_IFINDEX:
nh_family = AF_INET;
inet_ntop(nh_family, &api_nh->gate, 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';