summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_l2.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2017-05-15 07:38:26 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-12 18:26:02 +0200
commit13d60d351c4c70e8a2949ef45d88ec4efe382367 (patch)
treeb3846b88b4d3b03aa06801cac95d9a7992732076 /zebra/zebra_l2.c
parentzebra: VNI and VTEP definition (diff)
downloadfrr-13d60d351c4c70e8a2949ef45d88ec4efe382367.tar.xz
frr-13d60d351c4c70e8a2949ef45d88ec4efe382367.zip
zebra: VNI and VTEP handling
Implement fundamental handling for VNIs and VTEPs: - Handle EVPN enable/disable by client (advertise-all-vni) - Create/update/delete VNIs based on VxLAN interface events and inform client - Handle VTEP add/delete from client and install into kernel - New debug command for VxLAN/EVPN - kernel interface (Linux/netlink only) Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_l2.c')
-rw-r--r--zebra/zebra_l2.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c
index 5dd83baed..b71b96a18 100644
--- a/zebra/zebra_l2.c
+++ b/zebra/zebra_l2.c
@@ -42,6 +42,7 @@
#include "zebra/zebra_vrf.h"
#include "zebra/rt_netlink.h"
#include "zebra/zebra_l2.h"
+#include "zebra/zebra_vxlan.h"
/* definitions */
@@ -175,6 +176,7 @@ zebra_l2_vxlanif_add_update (struct interface *ifp,
if (add)
{
memcpy (&zif->l2info.vxl, vxlan_info, sizeof (*vxlan_info));
+ zebra_vxlan_if_add (ifp);
return;
}
@@ -183,6 +185,7 @@ zebra_l2_vxlanif_add_update (struct interface *ifp,
return;
zif->l2info.vxl.vtep_ip = vxlan_info->vtep_ip;
+ zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_LOCAL_IP_CHANGE);
}
/*
@@ -193,11 +196,17 @@ zebra_l2_vxlanif_update_access_vlan (struct interface *ifp,
vlanid_t access_vlan)
{
struct zebra_if *zif;
+ vlanid_t old_access_vlan;
zif = ifp->info;
assert(zif);
+ old_access_vlan = zif->l2info.vxl.access_vlan;
+ if (old_access_vlan == access_vlan)
+ return;
+
zif->l2info.vxl.access_vlan = access_vlan;
+ zebra_vxlan_if_update (ifp, ZEBRA_VXLIF_VLAN_CHANGE);
}
/*
@@ -206,7 +215,7 @@ zebra_l2_vxlanif_update_access_vlan (struct interface *ifp,
void
zebra_l2_vxlanif_del (struct interface *ifp)
{
- /* No action currently. */
+ zebra_vxlan_if_del (ifp);
}
/*
@@ -235,4 +244,8 @@ zebra_l2if_update_bridge_slave (struct interface *ifp,
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);
}