]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_l2.c
zebra: Fix VxLAN interface add-del to bridge
[mirror_frr.git] / zebra / zebra_l2.c
index 5d059a4502e691596232a77f9fe14c0464860e8a..452bab003a1416bd552ac4aa19b47d0d6e965c1b 100644 (file)
@@ -224,12 +224,18 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
        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);
+       }
 }