Skip to content

Commit

Permalink
bgpd: associate correct nexthop when using peer link-local
Browse files Browse the repository at this point in the history
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.

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 <[email protected]>
  • Loading branch information
pguibert6WIND committed Jul 1, 2021
1 parent 5a1b002 commit 57e0f76
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,14 @@ 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
ifp = if_lookup_by_ipv6_exact(
&local->sin6.sin6_addr,
local->sin6.sin6_scope_id,
peer->bgp->vrf_id);
} else if (peer->update_if)
ifp = if_lookup_by_name(peer->update_if,
peer->bgp->vrf_id);
Expand Down

0 comments on commit 57e0f76

Please sign in to comment.