zif->brslave_info.bridge_ifindex = bridge_ifindex;
/* Set up or remove link with master */
- if (bridge_ifindex != IFINDEX_INTERNAL)
- zebra_l2_map_slave_to_bridge(&zif->brslave_info);
- else if (old_bridge_ifindex != IFINDEX_INTERNAL)
- zebra_l2_unmap_slave_from_bridge(&zif->brslave_info);
-
- /* In the case of VxLAN, invoke the handler for EVPN. */
- if (zif->zif_type == ZEBRA_IF_VXLAN)
- zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+ if (bridge_ifindex != IFINDEX_INTERNAL) {
+ zebra_l2_map_slave_to_bridge (&zif->brslave_info);
+ /* In the case of VxLAN, invoke the handler for EVPN. */
+ if (zif->zif_type == ZEBRA_IF_VXLAN)
+ zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+ } else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
+ /* In the case of VxLAN, invoke the handler for EVPN. Note that
+ * this should be done *prior* to unmapping the interface from the
+ * bridge.
+ */
+ if (zif->zif_type == ZEBRA_IF_VXLAN)
+ zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_MASTER_CHANGE);
+ zebra_l2_unmap_slave_from_bridge (&zif->brslave_info);
+ }
}
continue;
}
ifp = zvni->vxlan_if;
- if (!ifp)
+ if (!ifp) {
zlog_err(
"VNI %u hash %p doesn't have intf upon remote MACIP DEL",
vni, zvni);
vxl->access_vlan, inet_ntoa(vxl->vtep_ip),
zif->brslave_info.bridge_ifindex, chgflags);
- /* Removed from bridge? */
+ /* Removed from bridge? Cleanup and return */
if ((chgflags & ZEBRA_VXLIF_MASTER_CHANGE)
&& (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
/* Delete from client, remove all remote VTEPs */
zvni_neigh_del_all(zvrf, zvni, 1, 0, DEL_ALL_NEIGH);
zvni_mac_del_all(zvrf, zvni, 1, 0, DEL_ALL_MAC);
zvni_vtep_del_all(zvni, 1);
- } else if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
+ return 0;
+ }
+
+ /* Handle other changes. */
+ if (chgflags & ZEBRA_VXLIF_VLAN_CHANGE) {
/* Remove all existing local neighbors and MACs for this VNI
* (including from BGP)
*/