Merge pull request #17600 from donaldsharp/bfd_shared_network

Bfd shared network
This commit is contained in:
Jafar Al-Gharaibeh 2024-12-05 22:13:39 -06:00 committed by GitHub
commit 38ca408c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 5 deletions

View File

@ -744,6 +744,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
int ret = 0; int ret = 0;
struct interface *ifp = NULL; struct interface *ifp = NULL;
bool v6_ll_avail = true; bool v6_ll_avail = true;
bool shared_network_original = peer->shared_network;
memset(nexthop, 0, sizeof(struct bgp_nexthop)); memset(nexthop, 0, sizeof(struct bgp_nexthop));
@ -838,9 +839,9 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
if (!v6_ll_avail && !peer->conf_if) if (!v6_ll_avail && !peer->conf_if)
v6_ll_avail = true; v6_ll_avail = true;
if (if_lookup_by_ipv4(&remote->sin.sin_addr, peer->bgp->vrf_id)) if (if_lookup_by_ipv4(&remote->sin.sin_addr, peer->bgp->vrf_id))
peer->shared_network = 1; peer->shared_network = true;
else else
peer->shared_network = 0; peer->shared_network = false;
} }
/* IPv6 connection, fetch and store IPv4 local address if any. */ /* IPv6 connection, fetch and store IPv4 local address if any. */
@ -903,11 +904,14 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
|| if_lookup_by_ipv6(&remote->sin6.sin6_addr, || if_lookup_by_ipv6(&remote->sin6.sin6_addr,
remote->sin6.sin6_scope_id, remote->sin6.sin6_scope_id,
peer->bgp->vrf_id)) peer->bgp->vrf_id))
peer->shared_network = 1; peer->shared_network = true;
else else
peer->shared_network = 0; peer->shared_network = false;
} }
if (shared_network_original != peer->shared_network)
bgp_peer_bfd_update_source(peer);
/* KAME stack specific treatment. */ /* KAME stack specific treatment. */
#ifdef KAME #ifdef KAME
if (IN6_IS_ADDR_LINKLOCAL(&nexthop->v6_global) if (IN6_IS_ADDR_LINKLOCAL(&nexthop->v6_global)

View File

@ -1330,7 +1330,7 @@ struct peer {
union sockunion *su_local; /* Sockunion of local address. */ union sockunion *su_local; /* Sockunion of local address. */
union sockunion *su_remote; /* Sockunion of remote address. */ union sockunion *su_remote; /* Sockunion of remote address. */
int shared_network; /* Is this peer shared same network. */ bool shared_network; /* Is this peer shared same network. */
struct bgp_nexthop nexthop; /* Nexthop */ struct bgp_nexthop nexthop; /* Nexthop */
/* Roles in bgp session */ /* Roles in bgp session */

View File

@ -5,9 +5,11 @@ router bgp 100
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 172.16.1.1 remote-as 100 neighbor 172.16.1.1 remote-as 100
neighbor 172.16.1.1 timers 3 10 neighbor 172.16.1.1 timers 3 10
neighbor 172.16.1.1 timers connect 1
neighbor 172.16.1.1 bfd profile fasttx neighbor 172.16.1.1 bfd profile fasttx
neighbor 2001:db8:2::2 remote-as 200 neighbor 2001:db8:2::2 remote-as 200
neighbor 2001:db8:2::2 timers 3 10 neighbor 2001:db8:2::2 timers 3 10
neighbor 2001:db8:2::2 timers connect 1
neighbor 2001:db8:2::2 ebgp-multihop 2 neighbor 2001:db8:2::2 ebgp-multihop 2
neighbor 2001:db8:2::2 bfd profile slowtx neighbor 2001:db8:2::2 bfd profile slowtx
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -2,6 +2,7 @@ router bgp 100
bgp router-id 10.254.254.3 bgp router-id 10.254.254.3
neighbor 172.16.1.2 remote-as 100 neighbor 172.16.1.2 remote-as 100
neighbor 172.16.1.2 timers 3 10 neighbor 172.16.1.2 timers 3 10
neighbor 172.16.1.2 timers connect 1
neighbor 172.16.1.2 bfd profile DOES_NOT_EXIST neighbor 172.16.1.2 bfd profile DOES_NOT_EXIST
address-family ipv4 unicast address-family ipv4 unicast
redistribute connected redistribute connected

View File

@ -5,6 +5,7 @@ router bgp 200
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 2001:db8:1::2 remote-as 100 neighbor 2001:db8:1::2 remote-as 100
neighbor 2001:db8:1::2 timers 3 10 neighbor 2001:db8:1::2 timers 3 10
neighbor 2001:db8:1::2 timers connect 1
neighbor 2001:db8:1::2 ebgp-multihop 2 neighbor 2001:db8:1::2 ebgp-multihop 2
neighbor 2001:db8:1::2 bfd profile DOES_NOT_EXIST neighbor 2001:db8:1::2 bfd profile DOES_NOT_EXIST
address-family ipv4 unicast address-family ipv4 unicast