aboutgitcodebugslistschat
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index b64c29e..fe0aab9 100644
--- a/util.c
+++ b/util.c
@@ -334,6 +334,14 @@ void sock_probe_features(struct ctx *c)
c->no_bindtodevice = 1;
}
+ /* Check if IPv6 sockets are usable */
+ close(s);
+ s = socket(AF_INET6, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
+ if (s < 0) {
+ c->no_ipv6 = true;
+ return;
+ }
+
close(s);
}