summaryrefslogtreecommitdiff
path: root/zebra/zebra_vxlan.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2017-11-09 09:13:28 -0800
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-12-14 10:57:07 -0800
commit3bcbba10a1232eb671fc4ac64338a80b42cc559c (patch)
treed1a7d7c96c496abe06b8f1f15312266ad808eccb /zebra/zebra_vxlan.c
parentbb7a24aba96f00b37234a99567c87a4904cfcd5a (diff)
zebra: Reinstall remote VTEP next hop when it becomes stale
When a remote VTEP next hop entry (for symmetric routing) becomes stale, reinstall it. This makes the behavior the same as what is done for remote host next hops (for asymmetric routing and ARP suppression). Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
-rw-r--r--zebra/zebra_vxlan.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 5e0ef54a39..f928554269 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -3203,6 +3203,27 @@ static int zl3vni_remote_nh_del(zebra_l3vni_t *zl3vni,
return 0;
}
+/* handle neigh update from kernel - the only thing of interest is to
+ * readd stale entries.
+ */
+static int zl3vni_local_nh_add_update(zebra_l3vni_t *zl3vni,
+ struct ipaddr *ip, u_int16_t state)
+{
+ zebra_neigh_t *n = NULL;
+
+ n = zl3vni_nh_lookup(zl3vni, ip);
+ if (!n)
+ return 0;
+
+ /* all next hop neigh are remote and installed by frr.
+ * If the kernel has aged this entry, re-install.
+ */
+ if (state & NUD_STALE)
+ zl3vni_nh_install(zl3vni, n);
+
+ return 0;
+}
+
/* handle neigh delete from kernel */
static int zl3vni_local_nh_del(zebra_l3vni_t *zl3vni,
struct ipaddr *ip)
@@ -4581,6 +4602,14 @@ int zebra_vxlan_local_neigh_add_update(struct interface *ifp,
zebra_vni_t *zvni = NULL;
zebra_neigh_t *n = NULL;
zebra_mac_t *zmac = NULL, *old_zmac = NULL;
+ zebra_l3vni_t *zl3vni = NULL;
+
+ /* check if this is a remote neigh entry corresponding to remote
+ * next-hop
+ */
+ zl3vni = zl3vni_from_svi(ifp, link_if);
+ if (zl3vni)
+ return zl3vni_local_nh_add_update(zl3vni, ip, state);
/* We are only interested in neighbors on an SVI that resides on top
* of a VxLAN bridge.