summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorOle Hansen <ole@redvw.com>2009-05-15 16:13:59 -0700
committerJeremy Allison <jra@samba.org>2009-05-15 16:13:59 -0700
commitad7dca471adc3a9c199bc651e9e3476150f1af28 (patch)
tree03113bd1cf3041a2859927acf77ab9c9202ce9a6 /source3/client
parentf5c96e54c633717ffe1a967f4ab9fdede31fa749 (diff)
downloadsamba-ad7dca471adc3a9c199bc651e9e3476150f1af28.tar.gz
samba-ad7dca471adc3a9c199bc651e9e3476150f1af28.tar.bz2
samba-ad7dca471adc3a9c199bc651e9e3476150f1af28.zip
Fix bug #6359 - smbclient -L does not list workgroup for hosts with both IPv4 and IPv6 addresses
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 9c53472840..3795472f6d 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) {