From b2b926d5876c0742c4b4b0c3748195fde9218820 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 12 Jun 2015 07:59:08 -0700 Subject: [PATCH] When peering is done on link-local address, always store the local address in the peer structure so that it can be used in setting the link-local nexthop in updates. This would ensure that in the absence of a global IPv6 address on the peering interface, a route-map can be used to specify a potentially arbitrary global v6 nexthop and that would be sent in conjunction with the correct link-local nexthop. --- bgpd/bgp_zebra.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 37c65eefce..054b0916ab 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -882,12 +882,16 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote, /* If there is no global address. Set link-local address as global. I know this break RFC specification... */ + /* In this scenario, the expectation for interop is that the + * network admin would use a route-map to specify the global + * IPv6 nexthop. + */ if (!ret) memcpy (&nexthop->v6_global, &local->sin6.sin6_addr, IPV6_MAX_BYTELEN); - else - memcpy (&nexthop->v6_local, &local->sin6.sin6_addr, - IPV6_MAX_BYTELEN); + /* Always set the link-local address */ + memcpy (&nexthop->v6_local, &local->sin6.sin6_addr, + IPV6_MAX_BYTELEN); } } -- 2.39.5