Allow dualstack binding again. - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 24a79c11d203eef18e389d5828393727629205a8 DIR parent 61d8eaf684d3c7751e63e04ad37411b53af101ac HTML Author: Christoph Lohmann <20h@r-36.net> Date: Sun, 11 Nov 2018 11:09:55 +0100 Allow dualstack binding again. Diffstat: M main.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) --- DIR diff --git a/main.c b/main.c @@ -301,9 +301,7 @@ getlistenfd(struct addrinfo *hints, char *bindip, char *port) char addstr[INET6_ADDRSTRLEN]; struct addrinfo *ai, *rp; void *sinaddr; - int on, reqaf, listfd, aierr, errno_save; - - reqaf = hints->ai_family; + int on, listfd, aierr, errno_save; if ((aierr = getaddrinfo(bindip, port, hints, &ai)) || ai == NULL) { fprintf(stderr, "getaddrinfo (%s:%s): %s\n", bindip, port, @@ -325,14 +323,6 @@ getlistenfd(struct addrinfo *hints, char *bindip, char *port) break; } - if (reqaf == AF_INET6 && - (setsockopt(listfd, IPPROTO_IPV6, IPV6_V6ONLY, &on, - sizeof(on)) < 0)) { - close(listfd); - listfd = -1; - break; - } - sinaddr = (rp->ai_family == AF_INET) ? (void *)&((struct sockaddr_in *)rp->ai_addr)->sin_addr : (void *)&((struct sockaddr_in6 *)rp->ai_addr)->sin6_addr;