From 3cb7e8d7ace5f0ba13193181d5f8d63aa1923e0b Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Fri, 25 Aug 2023 09:40:09 +0000 Subject: [PATCH] ignore some errors from socket(2) There's no much we can do if we resolv an IPv6 address but its support is disabled in the current kernel, so ignore and go ahead. Spotted while testing gmid i n a FreeBSD jail without IPv6. --- config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 92881ef..375d58d 100644 --- a/config.c +++ b/config.c @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -244,8 +245,11 @@ config_send_socks(struct conf *conf) TAILQ_FOREACH(addr, &conf->addrs, addrs) { sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); - if (sock == -1) + if (sock == -1) { + if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) + continue; fatal("socket"); + } v = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &v, sizeof(v))