Skip to content

Commit

Permalink
Fix kMaxIfNameLength constant scoping after #10979 (#11051)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored and pull[bot] committed Feb 18, 2022
1 parent afb5b87 commit c23d716
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
};
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c23d716

Please sign in to comment.