Skip to content

Commit

Permalink
[muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive…
Browse files Browse the repository at this point in the history
…() (sonic-net#2415)

* [muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive()

PR sonic-net#2407 added a check which returned true in isNeighborActive if it is
in the skip_neighbors_ list, but only checked for Mux in Subnet. This
extends that check to Mux Ports and Nexthop Muxes.
  • Loading branch information
Ndancejic authored Aug 17, 2022
1 parent cfcf3d8 commit c0168f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,11 +963,7 @@ bool MuxOrch::isNeighborActive(const IpAddress& nbr, const MacAddress& mac, stri

if (ptr)
{
if (ptr->getSkipNeighborsSet().find(nbr) != ptr->getSkipNeighborsSet().end())
{
return true;
}
return ptr->isActive();
return (ptr->isActive() || ptr->isSkipNeighbor(nbr));
}

string port;
Expand All @@ -981,15 +977,15 @@ bool MuxOrch::isNeighborActive(const IpAddress& nbr, const MacAddress& mac, stri
if (!port.empty() && isMuxExists(port))
{
MuxCable* ptr = getMuxCable(port);
return ptr->isActive();
return (ptr->isActive() || ptr->isSkipNeighbor(nbr));
}

NextHopKey nh_key = NextHopKey(nbr, alias);
string curr_port = getNexthopMuxName(nh_key);
if (port.empty() && !curr_port.empty() && isMuxExists(curr_port))
{
MuxCable* ptr = getMuxCable(curr_port);
return ptr->isActive();
return (ptr->isActive() || ptr->isSkipNeighbor(nbr));
}

return true;
Expand Down
4 changes: 2 additions & 2 deletions orchagent/muxorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ class MuxCable
{
return nbr_handler_->getNextHopId(nh);
}
std::set<IpAddress> getSkipNeighborsSet()
bool isSkipNeighbor(const IpAddress& nbr)
{
return skip_neighbors_;
return (skip_neighbors_.find(nbr) != skip_neighbors_.end());
}

private:
Expand Down

0 comments on commit c0168f3

Please sign in to comment.