]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: associate correct nexthop when using peer link-local
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 12 Jul 2021 07:22:41 +0000 (09:22 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 12 Jul 2021 07:23:22 +0000 (09:23 +0200)
When setting bgp configuration using peers referencing link local
ipv6 addresses, the bgp should be able to handle incoming bgp
connections, and find out the appropriate interface where the
connection comes from.

ipv6 link local sessions work by using bgp unnumbered interfaces
config, but it does not work if we have a shared media with
multiple potential link local ipv6 addresses on the network.

The fix consists in finding out the appropriate interface, when
the local configuration references a link local ipv6 addresses,
and the source address used references an interface. below
configuration illustrates what can be done then:

neighbor fe80::4113:5bba:2b61:b20c remote-as 55
neighbor fe80::4113:5bba:2b61:b20c update-source eth0

note: this change does not solve the ability for such config to
create an outgoing connection to remote peer (as the link local
ipv6 address config does not indicate which interface to use).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_zebra.c

index ec71e17034d31d6d6e785f024aa5a6a24e404029..2c7c0878553df20b1441d8be56df1212a71a579b 100644 (file)
@@ -750,6 +750,9 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
                                                                ? peer->conf_if
                                                                : peer->ifname,
                                                        peer->bgp->vrf_id);
+                       else if (peer->update_if)
+                               ifp = if_lookup_by_name(peer->update_if,
+                                                       peer->bgp->vrf_id);
                } else if (peer->update_if)
                        ifp = if_lookup_by_name(peer->update_if,
                                                peer->bgp->vrf_id);