From f9647f06f663a4f761d699bf9308ecda840807f9 Mon Sep 17 00:00:00 2001 From: Brad House Date: Sun, 19 Jan 2025 10:26:58 -0500 Subject: [PATCH] [neighsync] VXLAN EVPN neighbors not in NEIGH_TABLE (PR #3478) VXLAN EVPN learned routes are not entered into NEIGH_TABLE as per Issue #3384. The EVPN VXLAN HLD specifically states this should be populated so it triggers an update to the SAI database: https://github.com/sonic-net/SONiC/blob/master/doc/vxlan/EVPN/EVPN_VXLAN_HLD.md#438-mac-ip-route-handling The reason it was not occurring is NOARP entries were being rejected, this patch adds an exception for externally learned neighbors. Signed-off-by: Brad House (@bradh352) --- neighsyncd/neighsync.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/neighsyncd/neighsync.cpp b/neighsyncd/neighsync.cpp index 46f51b9266..ba4770b769 100644 --- a/neighsyncd/neighsync.cpp +++ b/neighsyncd/neighsync.cpp @@ -15,6 +15,11 @@ #include "warm_restart.h" #include +#ifndef NTF_EXT_LEARNED +/* from include/uapi/linux/neighbour.h */ +# define NTF_EXT_LEARNED (1 << 4) +#endif + using namespace std; using namespace swss; @@ -98,18 +103,28 @@ void NeighSync::onMsg(int nlmsg_type, struct nl_object *obj) { if ((isLinkLocalEnabled(intfName) == false) && (nlmsg_type != RTM_DELNEIGH)) { + SWSS_LOG_INFO("LinkLocal address received, ignoring for %s", ipStr); return; } } /* Ignore IPv6 multicast link-local addresses as neighbors */ if (family == IPV6_NAME && IN6_IS_ADDR_MC_LINKLOCAL(nl_addr_get_binary_addr(rtnl_neigh_get_dst(neigh)))) + { + SWSS_LOG_INFO("Multicast LinkLocal address received, ignoring for %s", ipStr); return; + } key+= ipStr; int state = rtnl_neigh_get_state(neigh); if (state == NUD_NOARP) { - return; + /* For externally learned neighbors, e.g. VXLAN EVPN, we want to keep + * these neighbors. */ + if (!(rtnl_neigh_get_flags(neigh) & NTF_EXT_LEARNED)) + { + SWSS_LOG_INFO("NOARP address received, ignoring for %s", ipStr); + return; + } } bool delete_key = false;