build: make VLAN code compatible with older kernels

Apparently VLAN_FLAG_LOOSE_BINDING isn't in older kernels like 2.6.32.
This commit is contained in:
Dan Williams 2012-03-09 12:20:42 -06:00
parent 6f19e1e18c
commit 7f717f905b
2 changed files with 27 additions and 0 deletions

View file

@ -261,6 +261,28 @@ if test "$ac_have_nl80211" = no; then
AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
fi
dnl
dnl Default to using WEXT but allow it to be disabled
dnl
AC_MSG_CHECKING([Linux kernel VLAN_FLAG_LOOSE_BINDING enum value])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#ifndef __user
#define __user
#endif
#include <sys/types.h>
#include <linux/types.h>
#include <linux/if_vlan.h>]],
[[unsigned int a = VLAN_FLAG_LOOSE_BINDING;]])],
[ac_have_vlan_flag_loose_binding=yes],
[ac_have_vlan_flag_loose_binding=no])
AC_MSG_RESULT($ac_have_vlan_flag_loose_binding)
if test "$ac_have_vlan_flag_loose_binding" = yes; then
AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 1, [Define if you have VLAN_FLAG_LOOSE_BINDING])
else
AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 0, [Define if you have VLAN_FLAG_LOOSE_BINDING])
fi
dnl
dnl Checks for libm - needed for pow()
dnl

View file

@ -65,6 +65,11 @@
#include <netlink/route/link/vlan.h>
#endif
#if !HAVE_VLAN_FLAG_LOOSE_BINDING
/* Older kernels don't have this flag */
#define VLAN_FLAG_LOOSE_BINDING 0x04
#endif
static void nm_system_device_set_priority (int ifindex,
NMIP4Config *config,
int priority);