mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 06:37:46 +00:00
[posix] loose check for NETLINK_EXT_ACK and NETLINK_CAP_ACK (#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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user