Skip to content

Commit

Permalink
bgpd: use bgp_labels_same in bgp_update()
Browse files Browse the repository at this point in the history
Use bgp_labels_same() for all label comparisons in bgpd.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Jan 26, 2024
1 parent f254f4b commit db1bb52
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db1bb52

Please sign in to comment.