Skip to content

Commit

Permalink
Handle Mac address 'none' (#2593)
Browse files Browse the repository at this point in the history
In some rare cases, kernel neighbor add notifications are received with Mac string as 'none'. Fixing this to prevent crash.
prsunny authored and yxieca committed Nov 6, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8dfd4af commit 178166e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions neighsyncd/neighsync.cpp
Original file line number Diff line number Diff line change
@@ -143,6 +143,12 @@ void NeighSync::onMsg(int nlmsg_type, struct nl_object *obj)
nl_addr2str(rtnl_neigh_get_lladdr(neigh), macStr, MAX_ADDR_SIZE);
}

if (!delete_key && !strncmp(macStr, "none", MAX_ADDR_SIZE))
{
SWSS_LOG_NOTICE("Mac address is 'none' for ADD op, ignoring for %s", ipStr);
return;
}

/* Ignore neighbor entries with Broadcast Mac - Trigger for directed broadcast */
if (!delete_key && (MacAddress(macStr) == MacAddress("ff:ff:ff:ff:ff:ff")))
{

0 comments on commit 178166e

Please sign in to comment.