diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-15 22:39:40 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-01-15 22:39:40 +0100 |
commit | bbc33f6ec310d98b9100fb883a2b8908ede1b5a8 (patch) | |
tree | 80fa7e950a9fcf44d23ea97cb299694424fd6881 | |
parent | 8988264a64dc9985303332568832b108dba3acd3 (diff) |
Netlink: Add another workaround for older kernel headers
Unfortunately, SOL_NETLINK is both recently added and arch-dependent,
so we cannot just define it.
-rw-r--r-- | sysdep/linux/netlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 27b1a617..ccd62f26 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -164,7 +164,14 @@ nl_open_sock(struct nl_sock *nl) static void 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)); +#endif } static void |