aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-04-07 22:50:00 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-04-09 05:20:27 +0200
commit09106ec02cdaec979e6178730e7c5e112ea6d368 (patch)
tree09bb6ed2768b39dfa79278d52d61edf8da8403bd /src/device.c
parentdata: alloca is actually as dangerous as they say (diff)
downloadwireguard-monolithic-historical-09106ec02cdaec979e6178730e7c5e112ea6d368.tar.xz
wireguard-monolithic-historical-09106ec02cdaec979e6178730e7c5e112ea6d368.zip
compat: support 3.16
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index fb87ccd..7e0f85c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -39,7 +39,9 @@ static int open(struct net_device *dev)
{
int ret;
struct wireguard_device *wg = netdev_priv(dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
struct inet6_dev *dev_v6 = __in6_dev_get(dev);
+#endif
struct in_device *dev_v4 = __in_dev_get_rtnl(dev);
if (dev_v4) {
@@ -50,12 +52,14 @@ static int open(struct net_device *dev)
IN_DEV_CONF_SET(dev_v4, SEND_REDIRECTS, false);
IPV4_DEVCONF_ALL(dev_net(dev), SEND_REDIRECTS) = false;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
if (dev_v6)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
dev_v6->addr_gen_mode = IN6_ADDR_GEN_MODE_NONE;
#else
dev_v6->cnf.addr_gen_mode = IN6_ADDR_GEN_MODE_NONE;
#endif
+#endif
ret = socket_init(wg);
if (ret < 0)