From 840faaeb00f1617649332dad82952e21e7c7fda7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 6 Dec 2011 14:51:10 +0400 Subject: bgpd: store nexthop info for redistributed IPV6 routes BGP was ignoring nexthop info for static and other redistributed routes for IPv6. Build extra attribute info to store the nexthop. See also: https://bugzilla.vyatta.com/show_bug.cgi?id=6073 --- bgpd/bgp_zebra.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'bgpd/bgp_zebra.c') diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index f3baeee0..d7af349a 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -281,7 +281,8 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length) inet_ntop(AF_INET, &nexthop, buf[1], sizeof(buf[1])), api.metric); } - bgp_redistribute_add((struct prefix *)&p, &nexthop, api.metric, api.type); + bgp_redistribute_add((struct prefix *)&p, &nexthop, NULL, + api.metric, api.type); } else { @@ -356,23 +357,29 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length) { if (BGP_DEBUG(zebra, ZEBRA)) { - char buf[INET6_ADDRSTRLEN]; - zlog_debug("Zebra rcvd: IPv6 route add %s %s/%d metric %u", + char buf[2][INET6_ADDRSTRLEN]; + zlog_debug("Zebra rcvd: IPv6 route add %s %s/%d nexthop %s metric %u", zebra_route_string(api.type), - inet_ntop(AF_INET6, &p.prefix, buf, sizeof(buf)), - p.prefixlen, api.metric); + inet_ntop(AF_INET6, &p.prefix, buf[0], sizeof(buf[0])), + p.prefixlen, + inet_ntop(AF_INET, &nexthop, buf[1], sizeof(buf[1])), + api.metric); } - bgp_redistribute_add ((struct prefix *)&p, NULL, api.metric, api.type); + bgp_redistribute_add ((struct prefix *)&p, NULL, &nexthop, + api.metric, api.type); } else { if (BGP_DEBUG(zebra, ZEBRA)) { - char buf[INET6_ADDRSTRLEN]; - zlog_debug("Zebra rcvd: IPv6 route delete %s %s/%d metric %u", + char buf[2][INET6_ADDRSTRLEN]; + zlog_debug("Zebra rcvd: IPv6 route delete %s %s/%d " + "nexthop %s metric %u", zebra_route_string(api.type), - inet_ntop(AF_INET6, &p.prefix, buf, sizeof(buf)), - p.prefixlen, api.metric); + inet_ntop(AF_INET6, &p.prefix, buf[0], sizeof(buf[0])), + p.prefixlen, + inet_ntop(AF_INET6, &nexthop, buf[1], sizeof(buf[1])), + api.metric); } bgp_redistribute_delete ((struct prefix *) &p, api.type); } -- cgit v1.2.1