mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-15 14:12:05 +00:00
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>
This commit is contained in:
parent
e93fa4daf0
commit
9771f1a03e
@ -5239,12 +5239,8 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
/* Update MPLS label */
|
/* Update MPLS label */
|
||||||
if (has_valid_label) {
|
if (has_valid_label) {
|
||||||
extra = bgp_path_info_extra_get(new);
|
extra = bgp_path_info_extra_get(new);
|
||||||
if (!bgp_labels_same((const mpls_label_t *)extra->label,
|
memcpy(&extra->label, label, num_labels * sizeof(mpls_label_t));
|
||||||
extra->num_labels, label, num_labels)) {
|
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))
|
if (!(afi == AFI_L2VPN && safi == SAFI_EVPN))
|
||||||
bgp_set_valid_label(&extra->label[0]);
|
bgp_set_valid_label(&extra->label[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user