From bb986e96dce86706535813f2d1ca8c249f9bbbe8 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 5 Nov 2024 15:53:43 +0100 Subject: [PATCH] bgpd: recheck leak nexthop validity When leak_update() rechecks an existing path, it considers nothing to update if the attributes and labels are not changed. However, it does not take into account the nexthop validity. Perform a leak update if the nexthop validity has changed. Signed-off-by: Louis Scalbert --- bgpd/bgp_mplsvpn.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 5ad5da3286..b55e8968b9 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1193,9 +1193,11 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn, return NULL; } - if (attrhash_cmp(bpi->attr, new_attr) && labelssame - && !CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED)) { - + if (attrhash_cmp(bpi->attr, new_attr) && labelssame && + !CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && + leak_update_nexthop_valid(to_bgp, bn, new_attr, afi, safi, source_bpi, bpi, + bgp_orig, p, + debug) == !!CHECK_FLAG(bpi->flags, BGP_PATH_VALID)) { bgp_attr_unintern(&new_attr); if (debug) zlog_debug(