@@ -162,6 +162,14 @@ AC_DEFUN([OVS_CHECK_LINUX_NETLINK], [
])],
[AC_DEFINE([HAVE_RTA_VIA], [1],
[Define to 1 if struct rtvia is available.])])
+
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include <linux/if_link.h>], [
+ int netnsid = IFLA_IF_NETNSID;
+ ])],
+ [AC_DEFINE([HAVE_IFLA_IF_NETNSID], [1],
+ [Define to 1 if IFLA_IF_NETNSID is available.])])
+
])
dnl OVS_CHECK_LINUX_TC
@@ -93,8 +93,8 @@ COVERAGE_DEFINE(netdev_linux_invalid_l4_csum);
COVERAGE_DEFINE(netdev_linux_unknown_l4_csum);
-#ifndef IFLA_IF_NETNSID
-#define IFLA_IF_NETNSID 0x45
+#ifndef HAVE_IFLA_IF_NETNSID
+#define IFLA_IF_NETNSID 46
#endif
/* These were introduced in Linux 2.6.14, so they might be missing if we have
* old headers. */
There are two issues with the way the value of IFLA_IF_NETNSID is currently being determined. Firstly, IFLA_IF_NETNSID is an enum value, not a preprocessor macro, but a preprocessor conditional is being used to check if it exists. So, from the preprocessor's PoV, it's always undefined. Secondly, the value being set is wrong. ``` $ cat > main.c << EOF int main() { return IFLA_IF_NETNSID; } EOF $ gcc main.c && ./a.out; echo $? 46 ``` I double checked just in case the value had changed since it was introduced: it hasn't. Fixes: 756819ddd788 ("netdev-linux: use netlink to update netdev.") Signed-off-by: Adrian Moreno <amorenoz@redhat.com> --- acinclude.m4 | 8 ++++++++ lib/netdev-linux.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-)