Skip to content

Commit

Permalink
Fix the Orchagent crash seen during Port channel OC test cases. (soni…
Browse files Browse the repository at this point in the history
…c-net#3042)

The function addNeighbor adds the remote system neighbor against the remote system port and increment the reference count for remote system port's RIF.
 However when it adds the nextHop in addNextHop function , it adds it against Inband port with RIF-ID of remote system port, but increases the RIF reference
 count of Inband port instead of remote system port.When the neighbor is removed in removeNeighbor, it decreases the ref count of remote system port for RIF.
 But when it removes the nexthop in removeNextHop, it decreases the ref count for remote system port. So if the remote system port has both ipv4 and ipv6 configured,
 then the ref count is incremented by 2 for remote system port's RIF (ipv4 and ipv4 nbr) and incremented by 2 (ipv4 and ipv6 nexthop) for Inband Port's RIF.
 But the ref count is decremented 4 times for remote system port's RIF. So sometimes, as soon as the ipv4 or ipv6 is delted, the orchagent tries to delete the
 remote system port's RIF, but since SAI meta layer has different ref count, it returns failure and orchagent crashes.

Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
  • Loading branch information
saksarav-nokia authored and mssonicbld committed Mar 8, 2024
1 parent 8d6aac0 commit 1d651e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ bool NeighOrch::addNextHop(const NextHopKey &nh)
next_hop_entry.nh_flags = 0;
m_syncdNextHops[nexthop] = next_hop_entry;

m_intfsOrch->increaseRouterIntfsRefCount(nexthop.alias);
m_intfsOrch->increaseRouterIntfsRefCount(nh.alias);

if (nexthop.isMplsNextHop())
{
Expand Down

0 comments on commit 1d651e8

Please sign in to comment.