diff options
| author | Sharath Ramamurthy <sramamurthy@nvidia.com> | 2021-07-27 21:50:47 +0530 |
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2023-02-13 18:12:04 -0500 |
| commit | feffe4eea6d4f6e533a9c22917163fa34a2119b6 (patch) | |
| tree | 61459464f2280dcded875c5df2470905ccf841ef /zebra/zebra_vxlan_if.c | |
| parent | 4a08e69746fd80300b89f0dac93ab5f609c47270 (diff) | |
zebra: Handle vni determination for non-vlan-aware bridges
This patch addresses following
- Remove unused VLAN Id parameter when trying to determine the VNI associated
with a non-VLAN aware bridge. Also, add a check to ensure that in this case,
we have a per-VNI VXLAN interface. Due to sequence of events, it is possible
that we may have VLAN-VNI mappings, in which case the code should return
gracefully.
- With support for a container VXLAN interface that has VLAN-VNI mappings,
the VXLAN interface itself may be up but a particular VNI might have
been removed. Ensure that VNI mapping exists before proceeding with
further processing.
Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
Diffstat (limited to 'zebra/zebra_vxlan_if.c')
| -rw-r--r-- | zebra/zebra_vxlan_if.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/zebra/zebra_vxlan_if.c b/zebra/zebra_vxlan_if.c index ce27cfb412..78a04372dc 100644 --- a/zebra/zebra_vxlan_if.c +++ b/zebra/zebra_vxlan_if.c @@ -655,6 +655,7 @@ struct zebra_vxlan_vni *zebra_vxlan_if_vni_find(const struct zebra_if *zif, return vnip; } + /* For SVD, the VNI value is a required parameter. */ assert(vni); memset(&vni_tmp, 0, sizeof(vni_tmp)); @@ -716,13 +717,17 @@ void zebra_vxlan_if_vni_walk(struct zebra_if *zif, hash_walk(vni_info->vni_table, zebra_vxlan_if_vni_walk_callback, &ctx); } -vni_t zebra_vxlan_if_access_vlan_vni_find(struct zebra_if *zif, vlanid_t vid, +vni_t zebra_vxlan_if_access_vlan_vni_find(struct zebra_if *zif, struct interface *br_if) { struct zebra_vxlan_vni *vni = NULL; - /* Expected to be called only for vlan-unware bridges */ - assert(!IS_ZEBRA_IF_BRIDGE_VLAN_AWARE((struct zebra_if *)br_if->info)); + /* Expected to be called only for vlan-unware bridges. In this case, + * we only support a per-VNI VXLAN interface model. + */ + if (!IS_ZEBRA_VXLAN_IF_VNI(zif)) + return 0; + vni = zebra_vxlan_if_vni_find(zif, 0); assert(vni); |
