diff options
| author | Russ White <russ@riw.us> | 2022-07-26 08:50:59 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-26 08:50:59 -0400 | 
| commit | 3bf314451761882f6a938247fe4af74e264576a9 (patch) | |
| tree | b5a8c2c8b281eac2907193e13c497d3af3bebabd /bgpd/bgp_mplsvpn.h | |
| parent | 749cf3c23d0d5db5e007a80539692b4ba36a49e7 (diff) | |
| parent | 943bfc4e824372a4eb036098464a301e9392f5dd (diff) | |
Merge pull request #11523 from pguibert6WIND/bgp_no_retain
Bgp no retain
Diffstat (limited to 'bgpd/bgp_mplsvpn.h')
| -rw-r--r-- | bgpd/bgp_mplsvpn.h | 13 | 
1 files changed, 10 insertions, 3 deletions
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index 715c40e197..c5cc7d4294 100644 --- a/bgpd/bgp_mplsvpn.h +++ b/bgpd/bgp_mplsvpn.h @@ -25,6 +25,7 @@  #include "bgpd/bgp_route.h"  #include "bgpd/bgp_rd.h"  #include "bgpd/bgp_zebra.h" +#include "bgpd/bgp_vty.h"  #define MPLS_LABEL_IS_SPECIAL(label) ((label) <= MPLS_LABEL_EXTENSION)  #define MPLS_LABEL_IS_NULL(label)                                              \ @@ -68,7 +69,7 @@ extern void vpn_leak_to_vrf_withdraw_all(struct bgp *to_bgp, afi_t afi);  extern void vpn_leak_to_vrf_update_all(struct bgp *to_bgp, struct bgp *from_bgp,  				       afi_t afi); -extern void vpn_leak_to_vrf_update(struct bgp *from_bgp, +extern bool vpn_leak_to_vrf_update(struct bgp *from_bgp,  				   struct bgp_path_info *path_vpn);  extern void vpn_leak_to_vrf_withdraw(struct bgp *from_bgp, @@ -231,8 +232,14 @@ static inline void vpn_leak_postchange(enum vpn_policy_direction direction,  	if (!bgp_vpn)  		return; -	if (direction == BGP_VPN_POLICY_DIR_FROMVPN) -		vpn_leak_to_vrf_update_all(bgp_vrf, bgp_vpn, afi); +	if (direction == BGP_VPN_POLICY_DIR_FROMVPN) { +		/* trigger a flush to re-sync with ADJ-RIB-in */ +		if (!CHECK_FLAG(bgp_vpn->af_flags[afi][SAFI_MPLS_VPN], +				BGP_VPNVX_RETAIN_ROUTE_TARGET_ALL)) +			bgp_clear_soft_in(bgp_vpn, afi, SAFI_MPLS_VPN); +		else +			vpn_leak_to_vrf_update_all(bgp_vrf, bgp_vpn, afi); +	}  	if (direction == BGP_VPN_POLICY_DIR_TOVPN) {  		if (bgp_vrf->vpn_policy[afi].tovpn_label !=  | 
