From c0168f35f2c3814d399e4a554e2ee81ab14d53f2 Mon Sep 17 00:00:00 2001 From: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com> Date: Wed, 17 Aug 2022 09:59:09 -0700 Subject: [PATCH] [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. --- orchagent/muxorch.cpp | 10 +++------- orchagent/muxorch.h | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index afc5ec412055..0561a2336763 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 c9b09fd8232f..5070818b0b0f 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: