summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-01-26 12:05:21 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2024-01-26 12:07:01 +0100
commitdb1bb52c4b618c68407cbde3e65386fa44824d6f (patch)
treecfbbb05dd8eea592dbb5f5804e81b450ef7d4300 /bgpd
parentbgpd: fix mpls label pointer comparison (diff)
downloadfrr-db1bb52c4b618c68407cbde3e65386fa44824d6f.tar.xz
frr-db1bb52c4b618c68407cbde3e65386fa44824d6f.zip
bgpd: use bgp_labels_same in bgp_update()
Use bgp_labels_same() for all label comparisons in bgpd. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 997d57117..8bcbd3dd8 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4520,12 +4520,12 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
hook_call(bgp_process, bgp, afi, safi, dest, peer, true);
/* Same attribute comes in. */
- if (!CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)
- && same_attr
- && (!has_valid_label
- || memcmp(&(bgp_path_info_extra_get(pi))->label, label,
- num_labels * sizeof(mpls_label_t))
- == 0)) {
+ if (!CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) && same_attr &&
+ (!has_valid_label ||
+ (bgp_path_info_extra_get(pi) &&
+ bgp_labels_same((const mpls_label_t *)pi->extra->label,
+ pi->extra->num_labels, label,
+ num_labels)))) {
if (CHECK_FLAG(bgp->af_flags[afi][safi],
BGP_CONFIG_DAMPENING)
&& peer->sort == BGP_PEER_EBGP