From c23d71672800ed3f6e6ca3a9293b4ee338722e0c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 27 Oct 2021 09:57:05 -0400 Subject: [PATCH] Fix kMaxIfNameLength constant scoping after #10979 (#11051) --- src/include/platform/ConnectivityManager.h | 2 +- src/platform/Linux/ConnectivityManagerImpl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 430a8f84baa390..11b07128ce04ec 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -55,7 +55,7 @@ constexpr size_t kMaxHardwareAddrSize = 8; struct NetworkInterface : public app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::Type { - char Name[Inet::InterfaceIterator::kMaxIfNameLength]; + char Name[Inet::InterfaceId::kMaxIfNameLength]; uint8_t MacAddress[kMaxHardwareAddrSize]; NetworkInterface * Next; /* Pointer to the next structure. */ }; diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 03f4f2ec95fde8..27ba37d5411692 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1068,8 +1068,8 @@ CHIP_ERROR ConnectivityManagerImpl::_GetNetworkInterfaces(NetworkInterface ** ne { NetworkInterface * ifp = new NetworkInterface(); - strncpy(ifp->Name, ifa->ifa_name, Inet::InterfaceIterator::kMaxIfNameLength); - ifp->Name[Inet::InterfaceIterator::kMaxIfNameLength - 1] = '\0'; + strncpy(ifp->Name, ifa->ifa_name, Inet::InterfaceId::kMaxIfNameLength); + ifp->Name[Inet::InterfaceId::kMaxIfNameLength - 1] = '\0'; ifp->name = CharSpan(ifp->Name, strlen(ifp->Name)); ifp->fabricConnected = ifa->ifa_flags & IFF_RUNNING;