summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_vxlan.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:55:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:55:46 +0000
commit4f40546c96c6aeaa4371161dca9db21071bcc5d2 (patch)
tree41199f3c71bb1b62bdee8e83577351f6ee70d031 /zebra/zebra_vxlan.c
parentAdding upstream version 10.0. (diff)
downloadfrr-4f40546c96c6aeaa4371161dca9db21071bcc5d2.tar.xz
frr-4f40546c96c6aeaa4371161dca9db21071bcc5d2.zip
Adding upstream version 10.0.1.upstream/10.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_vxlan.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 2ffaefd..0b75ec2 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -1763,9 +1763,9 @@ static int svd_remote_nh_add(struct zebra_l3vni *zl3vni,
} else if (memcmp(&nh->emac, rmac, ETH_ALEN) != 0) {
if (IS_ZEBRA_DEBUG_VXLAN)
- zlog_debug(
- "SVD RMAC change(%pEA --> %pEA) for nexthop %pIA, prefix %pFX",
- &nh->emac, rmac, vtep_ip, host_prefix);
+ zlog_debug("SVD RMAC change(%pEA --> %pEA) for nexthop %pIA, prefix %pFX refcnt %u",
+ &nh->emac, rmac, vtep_ip, host_prefix,
+ nh->refcnt);
memcpy(&nh->emac, rmac, ETH_ALEN);
/* install (update) the nh neigh in kernel */
@@ -2473,11 +2473,26 @@ static void zl3vni_del_rmac_hash_entry(struct hash_bucket *bucket, void *ctx)
/* delete and uninstall nh hash entry */
static void zl3vni_del_nh_hash_entry(struct hash_bucket *bucket, void *ctx)
{
- struct zebra_neigh *n = NULL;
+ struct zebra_neigh *n = NULL, *svd_nh = NULL;
struct zebra_l3vni *zl3vni = NULL;
n = (struct zebra_neigh *)bucket->data;
zl3vni = (struct zebra_l3vni *)ctx;
+
+ /* remove SVD based remote nexthop neigh entry */
+ svd_nh = svd_nh_lookup(&n->ip);
+ if (svd_nh) {
+ svd_nh->refcnt--;
+ if (IS_ZEBRA_DEBUG_VXLAN)
+ zlog_debug("%s L3VNI %u remove svd nh %pIA refcnt %u",
+ __func__, zl3vni->vni, &n->ip,
+ svd_nh->refcnt);
+ if (svd_nh->refcnt == 0) {
+ svd_nh_uninstall(zl3vni, svd_nh);
+ svd_nh_del(svd_nh);
+ }
+ }
+
zl3vni_nh_uninstall(zl3vni, n);
zl3vni_nh_del(zl3vni, n);
}