Skip to content

Commit 8a0bb36

Browse files
authored
Handle Mac address 'none' (sonic-net#2593)
In some rare cases, kernel neighbor add notifications are received with Mac string as 'none'. Fixing this to prevent crash.
1 parent f496ab3 commit 8a0bb36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

neighsyncd/neighsync.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ void NeighSync::onMsg(int nlmsg_type, struct nl_object *obj)
143143
nl_addr2str(rtnl_neigh_get_lladdr(neigh), macStr, MAX_ADDR_SIZE);
144144
}
145145

146+
if (!delete_key && !strncmp(macStr, "none", MAX_ADDR_SIZE))
147+
{
148+
SWSS_LOG_NOTICE("Mac address is 'none' for ADD op, ignoring for %s", ipStr);
149+
return;
150+
}
151+
146152
/* Ignore neighbor entries with Broadcast Mac - Trigger for directed broadcast */
147153
if (!delete_key && (MacAddress(macStr) == MacAddress("ff:ff:ff:ff:ff:ff")))
148154
{

0 commit comments

Comments
 (0)