diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index afc5ec41205..0561a233676 100644 --- a/orchagent/muxorch.cpp +++ b/orchagent/muxorch.cpp @@ -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; @@ -981,7 +977,7 @@ 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); @@ -989,7 +985,7 @@ bool MuxOrch::isNeighborActive(const IpAddress& nbr, const MacAddress& mac, stri 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; diff --git a/orchagent/muxorch.h b/orchagent/muxorch.h index c9b09fd8232..5070818b0b0 100644 --- a/orchagent/muxorch.h +++ b/orchagent/muxorch.h @@ -97,9 +97,9 @@ class MuxCable { return nbr_handler_->getNextHopId(nh); } - std::set getSkipNeighborsSet() + bool isSkipNeighbor(const IpAddress& nbr) { - return skip_neighbors_; + return (skip_neighbors_.find(nbr) != skip_neighbors_.end()); } private: