]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Define SOL_NETLINK for old versions of socket.h
authorTobias Brunner <tobias@strongswan.org>
Mon, 9 Jan 2023 15:57:53 +0000 (16:57 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 10 Jan 2023 15:34:07 +0000 (16:34 +0100)
While the kernel defines it since 2005 (2.6.14), some older versions of
socket.h shipped with C libraries might not.  In particular, glibc only
added it with 2.24 in 2016.

Closes strongswan/strongswan#1503

src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c

index 9b70705394ae4e513dfaebb368f421385c189734..abb9d16f803c10a0b870bfc880e5ffcc85e36c66 100644 (file)
 #include <collections/array.h>
 #include <collections/hashtable.h>
 
+/* some older versions of socket.h don't define this yet */
+#ifndef SOL_NETLINK
+#define SOL_NETLINK 270
+#endif
+
 typedef struct private_netlink_socket_t private_netlink_socket_t;
 
 /**