Skip to content

Commit

Permalink
[posix] loose check for NETLINK_EXT_ACK and NETLINK_CAP_ACK (openthre…
Browse files Browse the repository at this point in the history
…ad#9299)

`NETLINK_EXT_ACK` and `NETLINK_CAP_ACK` are for getting netlink reply
details from the kernel and we can still function without the two
options.

This commit loose the check of enabling the two options to make
ot-posix works on platforms where the features are missing.
  • Loading branch information
wgtdkp committed Jul 19, 2023
1 parent 57d9541 commit 7f4c7fc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/posix/platform/netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2004,10 +2004,18 @@ static void platformConfigureNetLink(void)
{
int enable = 1;

VerifyOrDie(setsockopt(sNetlinkFd, SOL_NETLINK, NETLINK_EXT_ACK, &enable, sizeof(enable)) == 0,
OT_EXIT_ERROR_ERRNO);
VerifyOrDie(setsockopt(sNetlinkFd, SOL_NETLINK, NETLINK_CAP_ACK, &enable, sizeof(enable)) == 0,
OT_EXIT_ERROR_ERRNO);
#if defined(NETLINK_EXT_ACK)
if (setsockopt(sNetlinkFd, SOL_NETLINK, NETLINK_EXT_ACK, &enable, sizeof(enable)) != 0)
{
otLogWarnPlat("[netif] Failed to enable NETLINK_EXT_ACK: %s", strerror(errno));
}
#endif
#if defined(NETLINK_CAP_ACK)
if (setsockopt(sNetlinkFd, SOL_NETLINK, NETLINK_CAP_ACK, &enable, sizeof(enable)) != 0)
{
otLogWarnPlat("[netif] Failed to enable NETLINK_CAP_ACK: %s", strerror(errno));
}
#endif
}
#endif

Expand Down

0 comments on commit 7f4c7fc

Please sign in to comment.