summaryrefslogtreecommitdiff
path: root/zebra/zebra_l2.c
diff options
context:
space:
mode:
authorSharath Ramamurthy <sramamurthy@nvidia.com>2021-07-27 14:54:40 +0530
committerStephen Worley <sworley@nvidia.com>2023-02-13 18:12:04 -0500
commitefde4f25612fb3a690ed1e0ce789a490f949bb2e (patch)
tree50630ce82382f9009ec471472a2ec2d244c103ab /zebra/zebra_l2.c
parent239b26f932e5b78828dce8f7fe628c12b7ddbd9f (diff)
zebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and zl3vni_from_svi
Today to find the vni for a given (vlan, bridge) we walk over all interfaces and filter the vxlan device associated with the bridge. With multiple vlan aware bridge changes, we can derive the vni directly by looking up the hash table i.e. the vlan_table of the associated (vlan, bridge) which would give the vni. During vrf_terminate() call zebra_l2_bridge_if_cleanup if the interface that we are removing is of type bridge. In this case, we walk over all the vlan<->access_bd association and clean them up. zebra_evpn_t is modified to record (vlan, bridge) details and the corresponding vty is modified to print the same. zevpn_bridge_if_set and zl3vni_bridge_if_set is used to set/unset the association. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
Diffstat (limited to 'zebra/zebra_l2.c')
-rw-r--r--zebra/zebra_l2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c
index e1de9a147a..c43fe49026 100644
--- a/zebra/zebra_l2.c
+++ b/zebra/zebra_l2.c
@@ -42,6 +42,7 @@
#include "zebra/rt_netlink.h"
#include "zebra/interface.h"
#include "zebra/zebra_l2.h"
+#include "zebra/zebra_l2_bridge_if.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_vxlan_if.h"
#include "zebra/zebra_evpn_mh.h"
@@ -263,12 +264,14 @@ void zebra_l2_bridge_add_update(struct interface *ifp,
int add)
{
struct zebra_if *zif;
+ struct zebra_l2_bridge_if *br;
zif = ifp->info;
assert(zif);
- /* Copy over the L2 information. */
- memcpy(&zif->l2info.br, bridge_info, sizeof(*bridge_info));
+ br = BRIDGE_FROM_ZEBRA_IF(zif);
+ br->vlan_aware = bridge_info->bridge.vlan_aware;
+ zebra_l2_bridge_if_add(ifp);
/* Link all slaves to this bridge */
map_slaves_to_bridge(ifp, 1, false, ZEBRA_BRIDGE_NO_ACTION);
@@ -279,6 +282,8 @@ void zebra_l2_bridge_add_update(struct interface *ifp,
*/
void zebra_l2_bridge_del(struct interface *ifp)
{
+ zebra_l2_bridge_if_del(ifp);
+
/* Unlink all slaves to this bridge */
map_slaves_to_bridge(ifp, 0, false, ZEBRA_BRIDGE_NO_ACTION);
}