diff options
| author | anlan_cs <vic.lan@pica8.com> | 2022-08-26 06:53:03 -0400 | 
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2022-08-26 21:55:52 -0400 | 
| commit | df78d91d8aab3bdb5b7fc8db6c451aa1d9be7b78 (patch) | |
| tree | 2ea634d8c31e95c1cb63a4b85d58078a9d5a57ef /zebra/zebra_vxlan.c | |
| parent | 5e48498795137416a9a497f21e81e7baf8f956ca (diff) | |
zebra: fix missing vni transition
`show evpn vni detail` doesn't reflect any change in vni transition.
Need to add processing in command of `[no] vni (1-16777215)`.
With the config:
```
!
vni 66
!
vrf vrf1
 vni 88
 exit-vrf
!
```
Before:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: <- Empty
```
After:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: 88 <-
```
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
| -rw-r--r-- | zebra/zebra_vxlan.c | 11 | 
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 5a6321ae7e..9fae556dd4 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -2090,6 +2090,7 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,  					     int add)  {  	struct zebra_evpn *zevpn = NULL; +	struct zebra_l3vni *zl3vni = NULL;  	/* There is a possibility that VNI notification was already received  	 * from kernel and we programmed it as L2-VNI @@ -2117,6 +2118,10 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,  		/* Free up all remote VTEPs, if any. */  		zebra_evpn_vtep_del_all(zevpn, 1); +		zl3vni = zl3vni_from_vrf(zevpn->vrf_id); +		if (zl3vni) +			listnode_delete(zl3vni->l2vnis, zevpn); +  		/* Delete the hash entry. */  		if (zebra_evpn_vxlan_del(zevpn)) {  			flog_err(EC_ZEBRA_VNI_DEL_FAILED, @@ -2172,8 +2177,12 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,  		/* Find bridge interface for the VNI */  		vlan_if = zvni_map_to_svi(vxl->access_vlan,  					  zif->brslave_info.br_if); -		if (vlan_if) +		if (vlan_if) {  			zevpn->vrf_id = vlan_if->vrf->vrf_id; +			zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id); +			if (zl3vni) +				listnode_add_sort_nodup(zl3vni->l2vnis, zevpn); +		}  		zevpn->vxlan_if = ifp;  		zevpn->local_vtep_ip = vxl->vtep_ip;  | 
