diff options
author | Don Slice <dslice@cumulusnetworks.com> | 2018-09-25 15:22:22 +0200 |
---|---|---|
committer | Don Slice <dslice@cumulusnetworks.com> | 2018-10-03 14:24:57 +0200 |
commit | 687a2b5dcccd7d7b288b7a00fcc6f39130f471e0 (patch) | |
tree | 223e6625e0a3795adeaacecefd58ed292fbcd418 /bgpd/bgp_nht.c | |
parent | Merge pull request #3004 from donaldsharp/other_peer (diff) | |
download | frr-687a2b5dcccd7d7b288b7a00fcc6f39130f471e0.tar.xz frr-687a2b5dcccd7d7b288b7a00fcc6f39130f471e0.zip |
bgpd: allow nht registration on ipv6 link-local addresses
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Testing Done: bgp-smoke completed with no new failures
While testing 5549 support using global addresses, discovered that
ipv6 nexthop tracking thru a route-reflector didn't work. Since
the next-hop used for remote nexthops resolves to the link-local
of the route-reflector, we need to track it in order to react to
interface down events. Also tripped over a crash in certain cases
which is also resolved in this fix.
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r-- | bgpd/bgp_nht.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index dd1ffe9f3..c94c70715 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -169,11 +169,6 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop, if (make_prefix(afi, ri, &p) < 0) return 1; } else if (peer) { - /* Don't register link local NH */ - if (afi == AFI_IP6 - && IN6_IS_ADDR_LINKLOCAL(&peer->su.sin6.sin6_addr)) - return 1; - if (!sockunion2hostprefix(&peer->su, &p)) { if (BGP_DEBUG(nht, NHT)) { zlog_debug( @@ -287,10 +282,6 @@ void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer) if (!peer) return; - /* We don't register link local address for NHT */ - if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL(&peer->su.sin6.sin6_addr)) - return; - if (!sockunion2hostprefix(&peer->su, &p)) return; @@ -437,8 +428,9 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id) * we receive from bgp. This is to allow us * to work with v4 routing over v6 nexthops */ - if (peer && - CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE) + if (peer && !peer->ifp + && CHECK_FLAG(peer->flags, + PEER_FLAG_CAPABILITY_ENHE) && nhr.prefix.family == AF_INET6) { struct interface *ifp; @@ -556,11 +548,6 @@ static int make_prefix(int afi, struct bgp_info *ri, struct prefix *p) } break; case AFI_IP6: - /* We don't register link local NH */ - if (ri->attr->mp_nexthop_len != BGP_ATTR_NHLEN_IPV6_GLOBAL - || IN6_IS_ADDR_LINKLOCAL(&ri->attr->mp_nexthop_global)) - return -1; - p->family = AF_INET6; if (is_bgp_static) { |