From 81c478eb175258b88453b99876e47233ea3615b9 Mon Sep 17 00:00:00 2001 From: vedganes Date: Wed, 17 Feb 2021 13:40:29 -0500 Subject: [PATCH] [voq/inbandif]Code review comments fix 3 Signed-off-by: vedganes Changes done to delete kernel neigh when there is failure in adding kernel neigh for voq system neighbors if kernel entry already exists. When there is mac change, system neighs are synced with changed mac. With voq inband port type, static neighbor for this system neighbors are added in kernel always with single chassis mac address. So to take care of skpping adding neighbor we delete the kernel neighbor so that next re-try will program the neighbor and hence the route addition will proceed. --- cfgmgr/nbrmgr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cfgmgr/nbrmgr.cpp b/cfgmgr/nbrmgr.cpp index 042f5b88b33..ad10fef9f4a 100644 --- a/cfgmgr/nbrmgr.cpp +++ b/cfgmgr/nbrmgr.cpp @@ -391,6 +391,9 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) if (!addKernelNeigh(nbr_odev, ip_address, mac_address)) { SWSS_LOG_ERROR("Neigh entry add on dev %s failed for '%s'", nbr_odev.c_str(), kfvKey(t).c_str()); + // Delete neigh to take care of deletion of exiting nbr for mac change. This makes sure that + // re-try will be successful and route addtion (below) will be attempted and be successful + delKernelNeigh(nbr_odev, ip_address); it++; continue; }