aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-25 19:45:16 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:25:23 +0100
commit424ff7b8ed77bf556e16fca94e72483daf846caa (patch)
treede01b8134cab4ddddb7261925779db6222ec19e4 /src/compat/compat.h
parentqemu: test using four cores (diff)
downloadwireguard-linux-compat-424ff7b8ed77bf556e16fca94e72483daf846caa.tar.xz
wireguard-linux-compat-424ff7b8ed77bf556e16fca94e72483daf846caa.zip
device: only take reference if netns is different
If we take two references, the namespace and the device are never freed in the usual manner. We should thus only take a reference to another namespace when it is a different namespace from our own. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 34353ea..cbb00e5 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -497,6 +497,11 @@ static inline int cpu_has_xfeatures(u64 xfeatures_needed, const char **feature_n
#endif
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
+struct _____dummy_container { char dev; };
+#define netdev_notifier_info net_device *)data); __attribute((unused)) char _____dummy = ((struct _____dummy_container
+#endif
+
/* https://lkml.org/lkml/2017/6/23/790 */
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <linux/ip.h>