diff options
author | Jeremy Allison <jra@samba.org> | 2009-01-15 10:29:34 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-01-15 10:29:34 -0800 |
commit | 354a2e03abda1e4c31256472ae721eadbf695591 (patch) | |
tree | b9e465750bebdba33ab4a5250fa6ab05dadd3f51 | |
parent | a0abb933d2acd8455a0560bfdbcc21deaf025432 (diff) | |
download | samba-354a2e03abda1e4c31256472ae721eadbf695591.tar.gz samba-354a2e03abda1e4c31256472ae721eadbf695591.tar.bz2 samba-354a2e03abda1e4c31256472ae721eadbf695591.zip |
Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails.
Jeremy.
-rw-r--r-- | source3/lib/util_sock.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index e913b35d60..b46ff2c462 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1940,11 +1940,12 @@ bool is_myname_or_ipaddr(const char *s) if (!is_ipaddress(servername)) { /* Use DNS to resolve the name, but only the first address */ struct sockaddr_storage ss; - if (interpret_string_addr(&ss, servername,0)) { - print_sockaddr(name, - sizeof(name), + if (interpret_string_addr(&ss, servername, 0)) { + char addr[INET6_ADDRSTRLEN]; + print_sockaddr(addr, + sizeof(addr), &ss); - servername = name; + servername = addr; } } |