Skip to content

Commit 4ebdad1

Browse files
[routesync] Fix for stale dynamic neighbor (#2553)
* [routesync] Fix for stale dynamic neighbor The changes are for fixing stale neighbor in the ASIC_DB and data path when eBGP neighbors are shutdown and neighbors are flushed. The problem is described in issue: #12442 The root cause of this issue is due to not deleing the route from the ASIC_DB when the route's next hop is on eth0 or docker0 interface. The solution is to delete the route entry from ASIC_DB instead of just returning when the route's next hop is on the interface eth0 or docker0 This commit fixes the warm restart unit test failure. When the route with only nh on eth0 or docker0 is removed and if the route is the default route, orchagent sends "add" black hole route to the syncd. So the ASIC DB gets n hset message. When this happens during warm restart, the unit test identifies this as unwanted setting and the unit test fails. To fix this issues, the route delete is sent only if the warm restart is not in progress. This is done following the same warm restart handling approach used for route delete in other palces. Signed-off-by: vedganes <[email protected]>
1 parent 8857f92 commit 4ebdad1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

fpmsyncd/routesync.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,32 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj, char *vrf)
733733
{
734734
SWSS_LOG_DEBUG("Skip routes to eth0 or docker0: %s %s %s",
735735
destipprefix, gw_list.c_str(), intf_list.c_str());
736+
// If intf_list has only this interface, that means all of the next hops of this route
737+
// have been removed and the next hop on the eth0/docker0 has become the only next hop.
738+
// In this case since we do not want the route with next hop on eth0/docker0, we return.
739+
// But still we need to clear the route from the APPL_DB. Otherwise the APPL_DB and data
740+
// path will be left with stale route entry
741+
if(alsv.size() == 1)
742+
{
743+
if (!warmRestartInProgress)
744+
{
745+
SWSS_LOG_NOTICE("RouteTable del msg for route with only one nh on eth0/docker0: %s %s %s %s",
746+
destipprefix, gw_list.c_str(), intf_list.c_str(), mpls_list.c_str());
747+
748+
m_routeTable.del(destipprefix);
749+
}
750+
else
751+
{
752+
SWSS_LOG_NOTICE("Warm-Restart mode: Receiving delete msg for route with only nh on eth0/docker0: %s %s %s %s",
753+
destipprefix, gw_list.c_str(), intf_list.c_str(), mpls_list.c_str());
754+
755+
vector<FieldValueTuple> fvVector;
756+
const KeyOpFieldsValuesTuple kfv = std::make_tuple(destipprefix,
757+
DEL_COMMAND,
758+
fvVector);
759+
m_warmStartHelper.insertRefreshMap(kfv);
760+
}
761+
}
736762
return;
737763
}
738764
}

0 commit comments

Comments
 (0)