Skip to content

Commit

Permalink
Handle Mac address 'none' (sonic-net#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.
  • Loading branch information
prsunny authored and yxieca committed Nov 6, 2023
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
Expand Up @@ -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")))
{
Expand Down

0 comments on commit 178166e

Please sign in to comment.