From 354a2e03abda1e4c31256472ae721eadbf695591 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 15 Jan 2009 10:29:34 -0800 Subject: [PATCH] Fix bug #6040 - Calling Samba print server with an aliased DNS-name fails. Jeremy. --- source3/lib/util_sock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index e913b35d607..b46ff2c462d 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; } } -- 2.11.4.GIT