From: Ondrej Zajicek (work) Date: Sat, 15 Jan 2022 21:39:40 +0000 (+0100) Subject: Netlink: Add another workaround for older kernel headers X-Git-Tag: v2.0.9~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc33f6ec310d98b9100fb883a2b8908ede1b5a8;p=thirdparty%2Fbird.git Netlink: Add another workaround for older kernel headers Unfortunately, SOL_NETLINK is both recently added and arch-dependent, so we cannot just define it. --- diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index 27b1a6178..ccd62f262 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