summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d431b7)
raw | patch | inline | side by side (parent: 6d431b7)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 10 Oct 2007 18:36:17 +0000 (20:36 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Fri, 12 Oct 2007 16:42:30 +0000 (18:42 +0200) |
Disable the ipvs module, if neither net/ip_vs.h nor ip_vs.h could be
found. Added HAVE_*_H checks for each included system header in ipvs.c.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
found. Added HAVE_*_H checks for each included system header in ipvs.c.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
configure.in | patch | blob | history | |
src/ipvs.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index 75e9131af65705b0b2d26a17bd1b109986e80289..d128d5e201c48236fe545eeac11b11c573defadb 100644 (file)
--- a/configure.in
+++ b/configure.in
#endif
])
+# For ipvs module
+have_net_ip_vs_h="no"
+have_ip_vs_h="no"
+if test "x$ac_system" = "xLinux"
+then
+ AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
+ AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
+fi
+
# For quota module
AC_CHECK_HEADERS(sys/ucred.h, [], [],
[
plugin_disk="yes"
plugin_entropy="yes"
plugin_interface="yes"
- plugin_ipvs="yes"
plugin_irq="yes"
plugin_load="yes"
plugin_memory="yes"
plugin_tcpconns="yes"
plugin_vserver="yes"
plugin_wireless="yes"
+
+ if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
+ then
+ plugin_ipvs="yes"
+ fi
fi
# Mac OS X devices
AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
+dnl ip_vs.h
+if test "x$ac_system" = "xLinux" -a "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
+then
+ enable_ipvs="$enable_ipvs (ip_vs.h not found)"
+fi
+
dnl Perl bindings
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 5755e06bd1a0a7635a20fcb73338b86ec888cce8..3c6aa5c12ff1666f66aff4640f1aacb13ff53b8f 100644 (file)
--- a/src/ipvs.c
+++ b/src/ipvs.c
#include "plugin.h"
#include "common.h"
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+#if HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif /* HAVE_ARPA_INET_H */
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif /* HAVE_SYS_SOCKET_H */
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif /* HAVE_NETINET_IN_H */
/* this can probably only be found in the kernel sources */
-#include <net/ip_vs.h>
+#if 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__)