diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-02-26 12:16:16 +0100 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-06-05 11:08:46 +0200 |
commit | 9771f1a03ea1a169a1ab2b5656ecf0719409f28c (patch) | |
tree | 557fc96310f28f46fab403a2c1ab603cedbed3a3 /bgpd | |
parent | bgpd: do not init labels in extra (diff) | |
download | frr-9771f1a03ea1a169a1ab2b5656ecf0719409f28c.tar.xz frr-9771f1a03ea1a169a1ab2b5656ecf0719409f28c.zip |
bgpd: optimize label copy for new path_info
In bgp_update(), path_info *new has just been created and has void
labels. bgp_labels_same() is always false.
Do not compare previous labels before setting them.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_route.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index b8fdb8999..8da30e789 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5239,12 +5239,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id, /* Update MPLS label */ if (has_valid_label) { extra = bgp_path_info_extra_get(new); - if (!bgp_labels_same((const mpls_label_t *)extra->label, - extra->num_labels, label, num_labels)) { - memcpy(&extra->label, label, - num_labels * sizeof(mpls_label_t)); - extra->num_labels = num_labels; - } + memcpy(&extra->label, label, num_labels * sizeof(mpls_label_t)); + extra->num_labels = num_labels; if (!(afi == AFI_L2VPN && safi == SAFI_EVPN)) bgp_set_valid_label(&extra->label[0]); } |