]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Extend RFC 5549 metaphor a bit more
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 6 Sep 2018 13:16:30 +0000 (09:16 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 19 Sep 2018 00:53:22 +0000 (20:53 -0400)
Currently we only support RFC 5549 in bgp via
using the `neighbor swp1 interface remote-as ...`
command.  This causes the extended capability
data to be traded as part of the open message.
Additionally at that point in time we notify
zebra to turn on the RA code for that interface
so that the zebra trick of turning the v6 nexthop
into a 169.254.0.1 nexthop and adding a neighbor
entry works.

This code change does 2 things:

1) Modify bgp to pass the extended capability
if we are attempting to establish a v4/unicast
session over a v6 peer.  In the past we limited
this to just the LL based peer.

2) Modify the nexthop tracking code to notice
when it receives nexthop data about the global v6
peer to turn on RA code on those interfaces we will
be using.  This will allow the v4 route with a v6
nexthop received in zebra to auto translate this
correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_nht.c
bgpd/bgp_open.c

index 3d2a4ee0dde9db8b1b1995d5ec758f6042214d1e..3ef7604b17e5064ed184ad80b99c8ed8a0c9b869 100644 (file)
@@ -401,6 +401,8 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
                bnc->change_flags |= BGP_NEXTHOP_CHANGED;
 
        if (nhr.nexthop_num) {
+               struct peer *peer = bnc->nht_info;
+
                /* notify bgp fsm if nbr ip goes from invalid->valid */
                if (!bnc->nexthop_num)
                        UNSET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
@@ -416,6 +418,22 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
 
                        nexthop = nexthop_from_zapi_nexthop(&nhr.nexthops[i]);
 
+                       /*
+                        * Turn on RA for the v6 nexthops
+                        * 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)
+                           && nhr.prefix.family == AF_INET6) {
+                               struct interface *ifp;
+
+                               ifp = if_lookup_by_index(nexthop->ifindex,
+                                                        nexthop->vrf_id);
+                               zclient_send_interface_radv_req(
+                                       zclient, nexthop->vrf_id, ifp, true,
+                                       BGP_UNNUM_DEFAULT_RA_INTERVAL);
+                       }
                        /* There is at least one label-switched path */
                        if (nexthop->nh_label &&
                                nexthop->nh_label->num_labels) {
index 62b412af0ca58077bf39d01bf6319e32c0993e8b..cf5901df5a4a619b4abaadd006ca28ceebe45d67 100644 (file)
@@ -1331,7 +1331,6 @@ void bgp_open_capability(struct stream *s, struct peer *peer)
                         */
                        if (CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE)
                            && peer->su.sa.sa_family == AF_INET6
-                           && IN6_IS_ADDR_LINKLOCAL(&peer->su.sin6.sin6_addr)
                            && afi == AFI_IP
                            && (safi == SAFI_UNICAST
                                || safi == SAFI_LABELED_UNICAST)) {