From 5c0aab103d3445d4516782915367625e0424431f Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 30 Jan 2024 15:18:43 +0100 Subject: [PATCH] bgpd: fix attr comparaison bgp_adj_in_set In bgp_adj_in_set(), attr has not yet been interned. adj->attr is always different from attr. adj->attr is always uninterned and interned even if attr and adj->attr are identical. Fix the comparison. Signed-off-by: Louis Scalbert --- bgpd/bgp_advertise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index 2ca3ffaa1ae8..a81f288c7acc 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -169,7 +169,7 @@ void bgp_adj_in_set(struct bgp_dest *dest, struct peer *peer, struct attr *attr, for (adj = dest->adj_in; adj; adj = adj->next) { if (adj->peer == peer && adj->addpath_rx_id == addpath_id) { - if (adj->attr != attr) { + if (!attrhash_cmp(adj->attr, attr)) { bgp_attr_unintern(&adj->attr); adj->attr = bgp_attr_intern(attr); }