Skip to content

Commit c0168f3

Browse files
authored
[muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive() (#2415)
* [muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive() PR #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.
1 parent cfcf3d8 commit c0168f3

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

orchagent/muxorch.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -963,11 +963,7 @@ bool MuxOrch::isNeighborActive(const IpAddress& nbr, const MacAddress& mac, stri
963963

964964
if (ptr)
965965
{
966-
if (ptr->getSkipNeighborsSet().find(nbr) != ptr->getSkipNeighborsSet().end())
967-
{
968-
return true;
969-
}
970-
return ptr->isActive();
966+
return (ptr->isActive() || ptr->isSkipNeighbor(nbr));
971967
}
972968

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

987983
NextHopKey nh_key = NextHopKey(nbr, alias);
988984
string curr_port = getNexthopMuxName(nh_key);
989985
if (port.empty() && !curr_port.empty() && isMuxExists(curr_port))
990986
{
991987
MuxCable* ptr = getMuxCable(curr_port);
992-
return ptr->isActive();
988+
return (ptr->isActive() || ptr->isSkipNeighbor(nbr));
993989
}
994990

995991
return true;

orchagent/muxorch.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ class MuxCable
9797
{
9898
return nbr_handler_->getNextHopId(nh);
9999
}
100-
std::set<IpAddress> getSkipNeighborsSet()
100+
bool isSkipNeighbor(const IpAddress& nbr)
101101
{
102-
return skip_neighbors_;
102+
return (skip_neighbors_.find(nbr) != skip_neighbors_.end());
103103
}
104104

105105
private:

0 commit comments

Comments
 (0)