]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Netlink: Add another workaround for older kernel headers
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 15 Jan 2022 21:39:40 +0000 (22:39 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sat, 15 Jan 2022 21:39:40 +0000 (22:39 +0100)
Unfortunately, SOL_NETLINK is both recently added and arch-dependent,
so we cannot just define it.

sysdep/linux/netlink.c

index 27b1a6178d77d3340fbfac041d427e5e3203556b..ccd62f2623a800a896378a88dabbd6e848c0d48a 100644 (file)
@@ -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