mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 01:19:51 +00:00
[posix] remove constants defined by macros (#6795)
This commit is contained in:
@@ -631,10 +631,6 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
#define kAddAddress true
|
||||
#define kRemoveAddress false
|
||||
#define kUnicastAddress true
|
||||
#define kMulticastAddress false
|
||||
static void logAddrEvent(bool isAdd, bool isUnicast, struct sockaddr_in6 &addr6, otError error)
|
||||
{
|
||||
char addressString[INET6_ADDRSTRLEN + 1];
|
||||
@@ -711,7 +707,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct nlmsghdr *aNetli
|
||||
error = otIp6SubscribeMulticastAddress(aInstance, &addr);
|
||||
}
|
||||
|
||||
logAddrEvent(kAddAddress, !addr.IsMulticast(), addr6, error);
|
||||
logAddrEvent(/* isAdd */ true, !addr.IsMulticast(), addr6, error);
|
||||
if (error == OT_ERROR_ALREADY)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -730,7 +726,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct nlmsghdr *aNetli
|
||||
error = otIp6UnsubscribeMulticastAddress(aInstance, &addr);
|
||||
}
|
||||
|
||||
logAddrEvent(kRemoveAddress, !addr.IsMulticast(), addr6, error);
|
||||
logAddrEvent(/* isAdd */ false, !addr.IsMulticast(), addr6, error);
|
||||
if (error == OT_ERROR_NOT_FOUND)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -914,7 +910,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct rt_msghdr *rtm)
|
||||
|
||||
if (subscribed)
|
||||
{
|
||||
logAddrEvent(kAddAddress, kUnicastAddress, addr6, OT_ERROR_ALREADY);
|
||||
logAddrEvent(/* isAdd */ true, /* isUnicast */ true, addr6, OT_ERROR_ALREADY);
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
@@ -964,7 +960,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct rt_msghdr *rtm)
|
||||
else
|
||||
{
|
||||
error = otIp6AddUnicastAddress(aInstance, &netAddr);
|
||||
logAddrEvent(kAddAddress, kUnicastAddress, addr6, error);
|
||||
logAddrEvent(/* isAdd */ true, /* isUnicast */ true, addr6, error);
|
||||
if (error == OT_ERROR_ALREADY)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -979,7 +975,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct rt_msghdr *rtm)
|
||||
netAddr.mAddress = addr;
|
||||
|
||||
error = otIp6SubscribeMulticastAddress(aInstance, &addr);
|
||||
logAddrEvent(kAddAddress, kMulticastAddress, addr6, error);
|
||||
logAddrEvent(/* isAdd */ true, /* isUnicast */ false, addr6, error);
|
||||
if (error == OT_ERROR_ALREADY)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -996,7 +992,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct rt_msghdr *rtm)
|
||||
if (!addr.IsMulticast())
|
||||
{
|
||||
error = otIp6RemoveUnicastAddress(aInstance, &addr);
|
||||
logAddrEvent(kRemoveAddress, kUnicastAddress, addr6, error);
|
||||
logAddrEvent(/* isAdd */ false, /* isUnicast */ true, addr6, error);
|
||||
if (error == OT_ERROR_NOT_FOUND)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -1005,7 +1001,7 @@ static void processNetifAddrEvent(otInstance *aInstance, struct rt_msghdr *rtm)
|
||||
else
|
||||
{
|
||||
error = otIp6UnsubscribeMulticastAddress(aInstance, &addr);
|
||||
logAddrEvent(kRemoveAddress, kMulticastAddress, addr6, error);
|
||||
logAddrEvent(/* isAdd */ false, /* isUnicast */ false, addr6, error);
|
||||
if (error == OT_ERROR_NOT_FOUND)
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
|
||||
Reference in New Issue
Block a user