From f4fd5c8e36f6f7e6d664b8542abdeada6fdfb46c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 11 Mar 2024 11:22:49 -0400 Subject: [PATCH] bgpd: Modify update_evpn_type5_route_entry to include path_info pointer Modify update_evpn_type5_route_entry to return a pointer to the struct bgp_path_info modified in this function. This code merely follows the standards used in other bgp_evpn.c code where the update function returns the pointer to the path info. Signed-off-by: Donald Sharp --- bgpd/bgp_evpn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index a846484f0e..8f9a4dbab2 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1561,7 +1561,8 @@ static struct bgp_path_info *bgp_evpn_route_get_local_path( static int update_evpn_type5_route_entry(struct bgp *bgp_evpn, struct bgp *bgp_vrf, afi_t afi, safi_t safi, struct bgp_dest *dest, - struct attr *attr, int *route_changed) + struct attr *attr, int *route_changed, + struct bgp_path_info **entry) { struct attr *attr_new = NULL; struct bgp_path_info *pi = NULL; @@ -1599,8 +1600,8 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_evpn, /* add the route entry to route node*/ bgp_path_info_add(dest, pi); + *entry = pi; } else { - tmp_pi = local_pi; if (!attrhash_cmp(tmp_pi->attr, attr)) { @@ -1622,6 +1623,7 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_evpn, tmp_pi->attr = attr_new; tmp_pi->uptime = monotime(NULL); } + *entry = local_pi; } return 0; } @@ -1637,6 +1639,7 @@ static int update_evpn_type5_route(struct bgp *bgp_vrf, struct prefix_evpn *evp, struct bgp_dest *dest = NULL; struct bgp *bgp_evpn = NULL; int route_changed = 0; + struct bgp_path_info *pi = NULL; bgp_evpn = bgp_get_evpn(); if (!bgp_evpn) @@ -1718,7 +1721,7 @@ static int update_evpn_type5_route(struct bgp *bgp_vrf, struct prefix_evpn *evp, /* create or update the route entry within the route node */ update_evpn_type5_route_entry(bgp_evpn, bgp_vrf, afi, safi, dest, &attr, - &route_changed); + &route_changed, &pi); /* schedule for processing and unlock node */ if (route_changed) { -- 2.39.5