diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-07 22:50:00 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 05:20:27 +0200 |
commit | 390f012f41d60215a4eed92a8d19ce7efd3707ff (patch) | |
tree | 1d236364428c650968bcad0306eae79a46c84f99 /src/device.c | |
parent | dfed22fb89b2a776ad4977d9d00ea319a6089d93 (diff) |
compat: support 3.16
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 4 |
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) |