summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-06 10:42:28 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-06 12:26:11 +1000
commit25ac58dccef5d1da9946aeb191d6b6c4ee8782cf (patch)
tree77ac1aad25f6c565debc7c8f927a4f9375e4168d /source4/lib/socket
parent5d2dbf93b3bfed193c6d8224be6e1d3af7e66d0f (diff)
downloadsamba-25ac58dccef5d1da9946aeb191d6b6c4ee8782cf.tar.gz
samba-25ac58dccef5d1da9946aeb191d6b6c4ee8782cf.tar.bz2
samba-25ac58dccef5d1da9946aeb191d6b6c4ee8782cf.zip
s4-ipv6: fix the address family for IPv6 string addresses
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index 41638b3d72..369cf5ff36 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -473,6 +473,11 @@ _PUBLIC_ struct socket_address *socket_address_from_strings(TALLOC_CTX *mem_ctx,
return NULL;
}
+ if (strcmp(family, "ip") == 0 && is_ipaddress_v6(host)) {
+ /* leaving as "ip" would force IPv4 */
+ family = "ipv6";
+ }
+
addr->family = family;
addr->addr = talloc_strdup(addr, host);
if (!addr->addr) {