From f4084abbb04ec73b4859b81a50d8ce3da91649ee Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Mon, 5 Feb 2024 14:43:11 +0100 Subject: [PATCH] fix Signed-off-by: Louis Scalbert --- bgpd/bgp_evpn.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index e87e3874b19e..f90ac3ec0247 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1565,22 +1565,22 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_evpn, /* See if this is an update of an existing route, or a new add. */ local_pi = bgp_evpn_route_get_local_path(bgp_evpn, dest); + + local_attr = *attr; + /* Type-5 routes advertise the L3-VNI */ + vni2label(bgp_vrf->l3vni, &label); + local_attr.label_tbl[0] = label; + assert(label); + local_attr.num_labels = 1; + /* * create a new route entry if one doesn't exist. * Otherwise see if route attr has changed */ if (!local_pi) { - /* route has changed as this is the first entry */ *route_changed = 1; - local_attr = *attr; - - /* Type-5 routes advertise the L3-VNI */ - vni2label(bgp_vrf->l3vni, &label); - local_attr.label_tbl[0] = label; - local_attr.num_labels = 1; - /* Add (or update) attribute to hash. */ attr_new = bgp_attr_intern(&local_attr); @@ -1594,14 +1594,14 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_evpn, } else { tmp_pi = local_pi; - if (!attrhash_cmp(tmp_pi->attr, attr)) { + if (!attrhash_cmp(tmp_pi->attr, &local_attr)) { /* attribute changed */ *route_changed = 1; /* The attribute has changed. */ /* Add (or update) attribute to hash. */ - attr_new = bgp_attr_intern(attr); + attr_new = bgp_attr_intern(&local_attr); bgp_path_info_set_flag(dest, tmp_pi, BGP_PATH_ATTR_CHANGED);