summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d316c8)
raw | patch | inline | side by side (parent: 3d316c8)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 1 Jul 2017 13:43:42 +0000 (15:43 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 1 Jul 2017 13:43:42 +0000 (15:43 +0200) |
Linux has shipped ipvs.h in its uapi for ages now.
Makefile.am | patch | blob | history | |
configure.ac | patch | blob | history | |
src/ipvs.c | patch | blob | history |
diff --git a/Makefile.am b/Makefile.am
index 529d4a92095a1aa02efd8deaade22ee99e72993c..719cfb8b43ea3288ee5141f2ffe37e8b4dd433a8 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
if BUILD_PLUGIN_IPVS
pkglib_LTLIBRARIES += ipvs.la
ipvs_la_SOURCES = src/ipvs.c
-ipvs_la_CFLAGS = $(AM_CFLAGS)
-if IP_VS_H_NEEDS_KERNEL_CFLAGS
-ipvs_la_CFLAGS += $(KERNEL_CFLAGS)
-endif
ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
diff --git a/configure.ac b/configure.ac
index ea3038120bc463b8472e450ce3dc012d09e7deaa..3357375ead98e8bd27269d756a455d6f360e458b 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
-if test "x$ac_system" = "xLinux"; then
- AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
- if test "x$KERNEL_DIR" = "x"; then
- KERNEL_DIR="/lib/modules/`uname -r`/source"
- fi
- KERNEL_CFLAGS="-I$KERNEL_DIR/include"
- AC_SUBST([KERNEL_CFLAGS])
-fi
-
if test "x$ac_system" = "xSolaris"; then
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.])
AC_DEFINE([_REENTRANT], [1], [Define to enable reentrancy interfaces.])
)
# For ipvs module
- AC_CHECK_HEADERS([linux/ip_vs.h], [have_linux_ip_vs_h="yes"], [have_linux_ip_vs="no"])
- AC_CHECK_HEADERS([net/ip_vs.h], [have_net_ip_vs_h="yes"], [have_net_ip_vs_h="no"])
- AC_CHECK_HEADERS([ip_vs.h], [have_ip_vs_h="yes"], [have_ip_vs_h="no"])
-
- ip_vs_h_needs_kernel_cflags="no"
-
- if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"; then
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $KERNEL_CFLAGS"
-
- AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
-
- AC_CHECK_HEADERS([linux/ip_vs.h], [have_linux_ip_vs_h="yes"])
- AC_CHECK_HEADERS([net/ip_vs.h], [have_net_ip_vs_h="yes"])
- AC_CHECK_HEADERS([ip_vs.h], [have_ip_vs_h="yes"])
-
- if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"; then
- ip_vs_h_needs_kernel_cflags="yes"
- fi
-
- CFLAGS="$SAVE_CFLAGS"
- fi
+ AC_CHECK_HEADERS_ONCE([linux/ip_vs.h])
# For the email plugin
AC_CHECK_HEADERS([linux/un.h], [], [],
have_linux_wireless_h="no"
fi
-AM_CONDITIONAL([IP_VS_H_NEEDS_KERNEL_CFLAGS], [test "x$ip_vs_h_needs_kernel_cflags" = "xyes"])
AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
# For the swap module
plugin_wireless="yes"
plugin_zfs_arc="yes"
- if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"; then
+ if test "x$ac_cv_header_linux_ip_vs_h" = "xyes"; then
plugin_ipvs="yes"
fi
AC_SUBST([LOAD_PLUGIN_NETWORK])
AC_SUBST([LOAD_PLUGIN_CSV])
-dnl ip_vs.h
-if test "x$ac_system" = "xLinux" && test "x$have_linux_ip_vs_h" = "xno" && "x$have_net_ip_vs_h" = "xno" && "x$have_ip_vs_h" = "xno"; then
- enable_ipvs="$enable_ipvs (ip_vs.h not found)"
-fi
-
-if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"; then
- enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
-fi
-
dnl Perl bindings
PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
diff --git a/src/ipvs.c b/src/ipvs.c
index cef2e2c87795ad88ce05e3da4ea4f83e477904a5..da67970d21dcb507441a1f35b3a866ede67f9361 100644 (file)
--- a/src/ipvs.c
+++ b/src/ipvs.c
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
-/* this can probably only be found in the kernel sources */
-#if HAVE_LINUX_IP_VS_H
#include <linux/ip_vs.h>
-#elif HAVE_NET_IP_VS_H
-#include <net/ip_vs.h>
-#elif HAVE_IP_VS_H
-#include <ip_vs.h>
-#endif /* HAVE_IP_VS_H */
#define log_err(...) ERROR("ipvs: " __VA_ARGS__)
#define log_info(...) INFO("ipvs: " __VA_ARGS__)