Skip to content

Commit

Permalink
Add externally learned (VXLAN EVPN) routes to NEIGH_TABLE so they get…
Browse files Browse the repository at this point in the history
… programmed in the ASIC
  • Loading branch information
bradh352 committed Jan 19, 2025
1 parent bf4408c commit 54b6ff2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion neighsyncd/neighsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
#include "warm_restart.h"
#include <algorithm>

#ifndef NTF_EXT_LEARNED
/* from include/uapi/linux/neighbour.h */
# define NTF_EXT_LEARNED (1 << 4)
#endif

using namespace std;
using namespace swss;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 54b6ff2

Please sign in to comment.