Skip to content

Commit 178166e

Browse files
prsunnyyxieca
authored andcommitted
Handle Mac address 'none' (#2593)
In some rare cases, kernel neighbor add notifications are received with Mac string as 'none'. Fixing this to prevent crash.
1 parent 8dfd4af commit 178166e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

neighsyncd/neighsync.cpp

Lines changed: 6 additions & 0 deletions
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)