Fix bug #6359 - smbclient -L does not list workgroup for hosts with both IPv4 and...
authorOle Hansen <ole@redvw.com>
Fri, 15 May 2009 23:13:59 +0000 (16:13 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 15 May 2009 23:13:59 +0000 (16:13 -0700)
source3/client/client.c

index 9c53472840929236b1ad7d31d65e5b594a35d8d0..3795472f6de7146a92b5a158b458e4f98a148892 100644 (file)
@@ -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) {