Fix reset the vlan flags when main interface is deleted. 05/10705/2
authorSteve Shin <jonshin@cisco.com>
Tue, 20 Feb 2018 19:38:34 +0000 (11:38 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 20 Feb 2018 21:40:59 +0000 (21:40 +0000)
The dot1q_vlans & dot1ad_vlans should be reset to 0 when main interface
is deleted. Otherwise, VPP will crash if the same interface index is reused
without attaching the sub interface on it.

Change-Id: I484d4a8892ff4241a3a32b22189746193d5f2594
Signed-off-by: Steve Shin <jonshin@cisco.com>
src/vnet/ethernet/interface.c

index 801c99f..091ca29 100644 (file)
@@ -344,6 +344,7 @@ ethernet_delete_interface (vnet_main_t * vnm, u32 hw_if_index)
            }
        }
       pool_put_index (em->vlan_pool, main_intf->dot1q_vlans);
+      main_intf->dot1q_vlans = 0;
     }
   if (main_intf->dot1ad_vlans)
     {
@@ -356,6 +357,7 @@ ethernet_delete_interface (vnet_main_t * vnm, u32 hw_if_index)
            }
        }
       pool_put_index (em->vlan_pool, main_intf->dot1ad_vlans);
+      main_intf->dot1ad_vlans = 0;
     }
 
   vnet_delete_hw_interface (vnm, hw_if_index);