summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_vxlan_if.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2021-04-28 21:45:29 +0200
committerStephen Worley <sworley@nvidia.com>2023-02-14 00:12:05 +0100
commita26daa77cc3229a81ee5d4da0a447941c8ae9bb9 (patch)
treebb792fdd547aee7458fd934b5a413fe1eee14af1 /zebra/zebra_vxlan_if.c
parentzebra: subscribe to bridge vlan netlink messages (diff)
downloadfrr-a26daa77cc3229a81ee5d4da0a447941c8ae9bb9.tar.xz
frr-a26daa77cc3229a81ee5d4da0a447941c8ae9bb9.zip
zebra: handle STP state change for SVD per vlan ID
Read in STP state changes for a Single Vxlan Device via bridge vlan netlink messages. Map the vlanid to a VNI in the SVD table and treat it similar to how we handle proto down of the Vxlan device traditionally in a non-SVD device scenario. Forwarding == Interface UP Blocking == Interface DOWN Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/zebra_vxlan_if.c')
-rw-r--r--zebra/zebra_vxlan_if.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan_if.c b/zebra/zebra_vxlan_if.c
index df9ad7795..e01d06c71 100644
--- a/zebra/zebra_vxlan_if.c
+++ b/zebra/zebra_vxlan_if.c
@@ -672,6 +672,36 @@ struct zebra_vxlan_vni *zebra_vxlan_if_vni_find(const struct zebra_if *zif,
return vnip;
}
+static int zif_vlanid_vni_walker(struct zebra_if *zif,
+ struct zebra_vxlan_vni *vnip, void *arg)
+{
+ struct zebra_vxlan_if_vlan_ctx *ctx;
+
+ ctx = (struct zebra_vxlan_if_vlan_ctx *)arg;
+
+ if (vnip->access_vlan == ctx->vid) {
+ ctx->vni = vnip;
+ return HASHWALK_ABORT;
+ }
+
+ return HASHWALK_CONTINUE;
+}
+
+struct zebra_vxlan_vni *zebra_vxlan_if_vlanid_vni_find(struct zebra_if *zif,
+ vlanid_t vid)
+{
+ struct zebra_vxlan_if_vlan_ctx ctx = {};
+
+ if (!IS_ZEBRA_VXLAN_IF_SVD(zif))
+ return NULL;
+
+ ctx.vid = vid;
+
+ zebra_vxlan_if_vni_walk(zif, zif_vlanid_vni_walker, &ctx);
+
+ return ctx.vni;
+}
+
void zebra_vxlan_if_vni_iterate(struct zebra_if *zif,
int (*func)(struct zebra_if *zif,
struct zebra_vxlan_vni *, void *),