summaryrefslogtreecommitdiffhomepage
path: root/src/socket.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-02-22 13:09:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-02-23 07:09:49 +0100
commit4b2ae43241e116fe50caa92f70655bde8ccb02eb (patch)
treee02850e2135e11483b18f91a7d277fc13417be26 /src/socket.c
parent7a30df394cda98f35a2274bfad27598f1064f685 (diff)
socket: do not try to create v6 socket when disabled
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index f799d91..f894cfe 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -345,6 +345,8 @@ retry:
rcu_assign_pointer(wg->sock4, new4->sk);
#if IS_ENABLED(CONFIG_IPV6)
+ if (!ipv6_mod_enabled())
+ goto out;
port6.local_udp_port = htons(wg->incoming_port);
ret = udp_sock_create(wg->creating_net, &port6, &new6);
if (ret < 0) {