summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_l2.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2017-07-20 18:54:46 +0200
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-08-17 11:48:41 +0200
commitaf026ae40eeeccea0b178f22b519bf9ba6862bb2 (patch)
treed2cdcbd7f710ccc9db4f3e5b4365cff64e3a2d85 /zebra/zebra_l2.c
parentzebra: Handle MACIP requests when in transient conditions (diff)
downloadfrr-af026ae40eeeccea0b178f22b519bf9ba6862bb2.tar.xz
frr-af026ae40eeeccea0b178f22b519bf9ba6862bb2.zip
zebra: Fix VxLAN interface add-del to bridge
Ensure that removal and addition of VxLAN interface from/to bridge is handled correctly. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_l2.c')
-rw-r--r--zebra/zebra_l2.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c
index 5d059a450..452bab003 100644
--- a/zebra/zebra_l2.c
+++ b/zebra/zebra_l2.c
@@ -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);
+ }
}