diff options
-rw-r--r-- | src/core/servers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/servers.c b/src/core/servers.c index 2f3d15d1..a5a8c701 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -198,8 +198,9 @@ static void server_connect_callback_readpipe(SERVER_REC *server) } else { /* pick the one that was found, or if both do it like /SET resolve_prefer_ipv6 says. */ - ip = iprec.ip6.family != 0 && - settings_get_bool("resolve_prefer_ipv6") ? + ip = iprec.ip4.family == 0 || + (iprec.ip6.family != 0 && + settings_get_bool("resolve_prefer_ipv6")) ? &iprec.ip6 : &iprec.ip4; } |