Netlink: Add another workaround for older kernel headers
Unfortunately, SOL_NETLINK is both recently added and arch-dependent, so we cannot just define it.
This commit is contained in:
parent
8988264a64
commit
bbc33f6ec3
1 changed files with 7 additions and 0 deletions
|
@ -164,7 +164,14 @@ nl_open_sock(struct nl_sock *nl)
|
||||||
static void
|
static void
|
||||||
nl_set_strict_dump(struct nl_sock *nl, int strict)
|
nl_set_strict_dump(struct nl_sock *nl, int strict)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Strict checking is not necessary, it improves behavior on newer kernels.
|
||||||
|
* If it is not available (missing SOL_NETLINK compile-time, or ENOPROTOOPT
|
||||||
|
* run-time), we can just ignore it.
|
||||||
|
*/
|
||||||
|
#ifdef SOL_NETLINK
|
||||||
setsockopt(nl->fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK, &strict, sizeof(strict));
|
setsockopt(nl->fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK, &strict, sizeof(strict));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue