summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-02-16 11:32:25 -0500
committerGitHub <noreply@github.com>2021-02-16 11:32:25 -0500
commitdba34d41a10df41e966a8de550ee609d08a6f098 (patch)
treee63201e98155b19979afe44b560477cc1ae0a167
parentf8bdd66fbfa2655e24de1239d1d32e7bf6cdd84e (diff)
parent6b9265a3f2749def6e2f97b980be665789e3e49d (diff)
Merge pull request #8059 from ton31337/fix/nexthop_ipv4_handling_table_map_apply
bgpd: Print IPv4 nexthop for IPv6 prefixes under bgp_table_map_apply()
-rw-r--r--bgpd/bgp_zebra.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 627e996937..8d03079fd7 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -954,8 +954,11 @@ static bool bgp_table_map_apply(struct route_map *map, const struct prefix *p,
zlog_debug(
"Zebra rmap deny: IPv6 route %pFX nexthop %s",
p,
- inet_ntop(AF_INET6, nexthop, buf[1],
- sizeof(buf[1])));
+ nexthop ? inet_ntop(AF_INET6, nexthop, buf[1],
+ sizeof(buf[1]))
+ : inet_ntop(AF_INET,
+ &path->attr->nexthop,
+ buf[1], sizeof(buf[1])));
}
}
return false;