summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2025-02-10 23:39:55 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2025-02-10 23:50:26 +0200
commitc91c5e8463a06c6557e340da1188fd8f320a30b1 (patch)
tree96423df7d4e5b17af5d0aa3c16b950fa4ff4f1b4
parente4b14dae7c7dc62d32f2d076d2e8e07a93388503 (diff)
bgpd: Make sure Link-Local Next Hop capability has its own update-group
We should involve checking received (not only advertised) capability, because otherwise we put both peers (one with LL capability, another without) into a single update-group and send 16-bytes NH instead of 16-bytes and 32-bytes separately. Fixes: db853cc97eafee8742cd391aaa2b5bc58a6751ae ("bgpd: Implement Link-Local Next Hop capability") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--bgpd/bgp_updgrp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index c6b1ff1d2f..04e6a83552 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -444,6 +444,14 @@ static unsigned int updgrp_hash_key_make(const void *p)
*/
key = jhash_1word(peer->local_role, key);
+ /* If the peer has disabled Link-Local Next Hop capability, but we
+ * send it, it's not taken into consideration and we always merge both
+ * peers into a single update-group. Make sure peer has its own update-group
+ * if it has disabled (received) Link-Local Next Hop capability.
+ */
+ key = jhash_2words(!!CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_RCV),
+ !!CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_ADV), key);
+
/* Neighbors configured with the AIGP attribute are put in a separate
* update group from other neighbors.
*/
@@ -480,6 +488,9 @@ static unsigned int updgrp_hash_key_make(const void *p)
zlog_debug("%pBP Update Group Hash: addpath paths-limit: (send %u, receive %u)",
peer, peer->addpath_paths_limit[afi][safi].send,
peer->addpath_paths_limit[afi][safi].receive);
+ zlog_debug("%pBP Update Group Hash: Link-Local Next Hop capability:%s%s", peer,
+ CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_RCV) ? " received" : "",
+ CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_ADV) ? " advertised" : "");
zlog_debug(
"%pBP Update Group Hash: max packet size: %u pmax_out: %u Peer Group: %s rmap out: %s",
peer, peer->max_packet_size, peer->pmax_out[afi][safi],