From: Ole Hansen Date: Fri, 15 May 2009 23:13:59 +0000 (-0700) Subject: Fix bug #6359 - smbclient -L does not list workgroup for hosts with both IPv4 and... X-Git-Tag: tdb-1.1.5~521 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad7dca471adc3a9c199bc651e9e3476150f1af28;p=thirdparty%2Fsamba.git Fix bug #6359 - smbclient -L does not list workgroup for hosts with both IPv4 and IPv6 addresses --- diff --git a/source3/client/client.c b/source3/client/client.c index 9c534728409..3795472f6de 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4563,10 +4563,16 @@ static int do_host_query(const char *query_host) browse_host(true); - if (interpret_string_addr(&ss, query_host, 0) && (ss.ss_family != AF_INET)) { - d_printf("%s is an IPv6 address -- no workgroup available\n", - query_host); - return 1; + /* Ensure that the host can do IPv4 */ + + if (!interpret_addr(query_host)) { + struct sockaddr_storage ss; + if (interpret_string_addr(&ss, query_host, 0) && + (ss.ss_family != AF_INET)) { + d_printf("%s is an IPv6 address -- no workgroup available\n", + query_host); + return 1; + } } if (port != 139) {