diff options
| author | anlan_cs <vic.lan@pica8.com> | 2023-04-12 21:40:26 +0800 | 
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2023-04-13 08:47:06 +0800 | 
| commit | e2c7a84bddba2b1b1446488a96a9f6d6260e0181 (patch) | |
| tree | bb884e5a6036b9e866e7ecbbbd53d80f05f08316 /bgpd/bgp_evpn.c | |
| parent | 13a1758a6a2ef78359eec913300693f19d80ea48 (diff) | |
bgpd: Simplify the checking local path
Replace the checking local path code in `update_evpn_type5_route_entry()`
with generic function.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
| -rw-r--r-- | bgpd/bgp_evpn.c | 11 | 
1 files changed, 3 insertions, 8 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 81117e94ef..159cb33fee 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1513,14 +1513,9 @@ static int update_evpn_type5_route_entry(struct bgp *bgp_evpn,  	struct bgp_path_info *tmp_pi = NULL;  	*route_changed = 0; -	/* locate the local route entry if any */ -	for (tmp_pi = bgp_dest_get_bgp_path_info(dest); tmp_pi; -	     tmp_pi = tmp_pi->next) { -		if (tmp_pi->peer == bgp_evpn->peer_self -		    && tmp_pi->type == ZEBRA_ROUTE_BGP -		    && tmp_pi->sub_type == BGP_ROUTE_STATIC) -			local_pi = tmp_pi; -	} + +	/* 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);  	/*  	 * create a new route entry if one doesn't exist.  | 
