mirror of https://github.com/omar-polo/gmid.git
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.
This commit is contained in:
parent
39204b7e48
commit
3cb7e8d7ac
6
config.c
6
config.c
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue