From 3c1af627f97fd7e6726fb5361fc642dc6d699695 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 1 Jul 2017 15:43:42 +0200 Subject: [PATCH] ipvs plugin: remove custom kernel source support Linux has shipped ipvs.h in its uapi for ages now. --- Makefile.am | 4 ---- configure.ac | 44 ++------------------------------------------ src/ipvs.c | 7 ------- 3 files changed, 2 insertions(+), 53 deletions(-) diff --git a/Makefile.am b/Makefile.am index 529d4a92..719cfb8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -940,10 +940,6 @@ endif 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 ea303812..3357375e 100644 --- a/configure.ac +++ b/configure.ac @@ -112,15 +112,6 @@ AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"]) 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.]) @@ -518,28 +509,7 @@ if test "x$ac_system" = "xLinux"; then ) # 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], [], [], @@ -610,7 +580,6 @@ else 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 @@ -6185,7 +6154,7 @@ if test "x$ac_system" = "xLinux"; then 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 @@ -6712,15 +6681,6 @@ AC_SUBST([LOAD_PLUGIN_RRDTOOL]) 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 cef2e2c8..da67970d 100644 --- a/src/ipvs.c +++ b/src/ipvs.c @@ -42,14 +42,7 @@ #include #endif /* HAVE_NETINET_IN_H */ -/* this can probably only be found in the kernel sources */ -#if HAVE_LINUX_IP_VS_H #include -#elif HAVE_NET_IP_VS_H -#include -#elif HAVE_IP_VS_H -#include -#endif /* HAVE_IP_VS_H */ #define log_err(...) ERROR("ipvs: " __VA_ARGS__) #define log_info(...) INFO("ipvs: " __VA_ARGS__) -- 2.11.0