diff --git a/src/posix/platform/netif.cpp b/src/posix/platform/netif.cpp index 58f7513c7..55c7079aa 100644 --- a/src/posix/platform/netif.cpp +++ b/src/posix/platform/netif.cpp @@ -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;