[posix] make mInfraIfIndex non-static for posix::InfraIf (#8546)

We should not use static member fields given the `posix::InfraIf` is
already a singleton. Instead, let's make it consistent with the rest
of the fields which are all non-static.
This commit is contained in:
Kangping
2022-12-19 09:10:54 -08:00
committed by GitHub
parent a0d35548d9
commit 50ed30fcd9
2 changed files with 5 additions and 7 deletions
+1 -3
View File
@@ -62,8 +62,6 @@
#include "lib/platform/exit_code.h"
#include "posix/platform/infra_if.hpp"
uint32_t ot::Posix::InfraNetif::mInfraIfIndex = 0;
bool otPlatInfraIfHasAddress(uint32_t aInfraIfIndex, const otIp6Address *aAddress)
{
bool ret = false;
@@ -599,7 +597,7 @@ void InfraNetif::DiscoverNat64PrefixDone(union sigval sv)
}
}
otPlatInfraIfDiscoverNat64PrefixDone(gInstance, mInfraIfIndex, &prefix);
otPlatInfraIfDiscoverNat64PrefixDone(gInstance, Get().mInfraIfIndex, &prefix);
exit:
freeaddrinfo(res);
+4 -4
View File
@@ -164,10 +164,10 @@ private:
static const otIp4Address kWellKnownIpv4OnlyAddress2; // 192.0.0.171
static const uint8_t kValidNat64PrefixLength[];
char mInfraIfName[IFNAMSIZ];
static uint32_t mInfraIfIndex;
int mInfraIfIcmp6Socket = -1;
int mNetLinkSocket = -1;
char mInfraIfName[IFNAMSIZ];
uint32_t mInfraIfIndex = 0;
int mInfraIfIcmp6Socket = -1;
int mNetLinkSocket = -1;
void ReceiveNetLinkMessage(void);
void ReceiveIcmp6Message(void);