From d87e0e41129d067a7c07cded9b81161456686941 Mon Sep 17 00:00:00 2001 From: Jeffrey Leung Date: Tue, 15 Oct 2024 16:58:12 -0700 Subject: [PATCH] Fix fabric port conditional check Summary: Fix conditional check implemented in D63735194 which mistakenly printed loopback IPs for fabric ports in the fboss2 show interface command. Reviewed By: shri-khare Differential Revision: D64424798 fbshipit-source-id: e0f54f244be4df1c333cd3f14d1c7699d1126d6d --- fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h b/fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h index e8f871cf1c69a..c6637d95e181d 100644 --- a/fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h +++ b/fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h @@ -283,7 +283,9 @@ class CmdShowInterface std::string name = *interface.name(); std::vector prefixes; - if (interface.portType() == cfg::PortType::FABRIC_PORT || + // TODO (jycleung) portType is a new field addition to the interface. + // When D63407523 is rolled out to the fleet, remove the name check. + if (interface.portType() != cfg::PortType::FABRIC_PORT && !name.starts_with("fab")) { // Skip addresses for fabric ports for (const auto& prefix : *interface.prefixes()) { prefixes.push_back(