summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-12-09 18:36:13 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-12-09 21:31:12 +0100
commit0f9bd6ea00bfc085001f1f66f445d2026674d5cb (patch)
treeb0c0c8605ba99c7f8e38b0c1fdb535ae39e6146a /src
parentsocket: clear src address when retrying handshake (diff)
downloadwireguard-monolithic-historical-0f9bd6ea00bfc085001f1f66f445d2026674d5cb.tar.xz
wireguard-monolithic-historical-0f9bd6ea00bfc085001f1f66f445d2026674d5cb.zip
compat: build dep errors belong here, since it's out of tree specific
Diffstat (limited to 'src')
-rw-r--r--src/compat.h9
-rw-r--r--src/ratelimiter.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/src/compat.h b/src/compat.h
index 21487cb..c286fec 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -11,6 +11,15 @@
#error "WireGuard requires Linux >= 4.1"
#endif
+/* These conditionals can't be enforced by an out of tree module very easily,
+ * so we stick them here in compat instead. */
+#if !IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT)
+#error "WireGuard requires CONFIG_NETFILTER_XT_MATCH_HASHLIMIT."
+#endif
+#if IS_ENABLED(CONFIG_IPV6) && !IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
+#error "WireGuard requires CONFIG_IP6_NF_IPTABLES when using CONFIG_IPV6."
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) && !defined(DEBUG) && defined(net_dbg_ratelimited)
#undef net_dbg_ratelimited
#define net_dbg_ratelimited(fmt, ...) do { if (0) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0)
diff --git a/src/ratelimiter.c b/src/ratelimiter.c
index 7c23d55..be3e6a1 100644
--- a/src/ratelimiter.c
+++ b/src/ratelimiter.c
@@ -4,17 +4,10 @@
#include "peer.h"
#include "device.h"
-#include <linux/netfilter/x_tables.h>
#include <linux/module.h>
+#include <linux/netfilter/x_tables.h>
#include <net/ip.h>
-#if !IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT)
-#error "WireGuard requires CONFIG_NETFILTER_XT_MATCH_HASHLIMIT."
-#endif
-#if IS_ENABLED(CONFIG_IPV6) && !IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
-#error "WireGuard requires CONFIG_IP6_NF_IPTABLES when using CONFIG_IPV6."
-#endif
-
static struct xt_match *v4_match;
#if IS_ENABLED(CONFIG_IPV6)
static struct xt_match *v6_match;