evsocket::canIPv6 once

This commit is contained in:
Michael Davidsaver
2021-12-12 18:18:22 -08:00
parent 89fd1bba7a
commit 1be0477ee6
11 changed files with 26 additions and 12 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ ServIface::ServIface(const SockAddr &addr, server::Server::Pvt *server, bool fal
auto orig_port = bind_addr.port();
#ifdef __linux__
if(server->canIPv6 && bind_addr.family()==AF_INET && bind_addr.isAny()) {
if(evsocket::canIPv6 && bind_addr.family()==AF_INET && bind_addr.isAny()) {
// Linux IP stack disallows binding both 0.0.0.0 and [::] for the same port.
// so promote to IPv6 when possible
bind_addr = SockAddr::any(AF_INET6, bind_addr.port());