summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-04-17 09:24:54 -0700
committerJeremy Allison <jra@samba.org>2008-04-17 09:24:54 -0700
commit4939a24cbc751719b008bdd474181fffabd33934 (patch)
treef669494e5396b83ee13e751d3fa6a601d96faeb3
parenta4c60b2696962c7f83e033e00d97e4b1dacc05c9 (diff)
downloadsamba-4939a24cbc751719b008bdd474181fffabd33934.tar.gz
samba-4939a24cbc751719b008bdd474181fffabd33934.tar.bz2
samba-4939a24cbc751719b008bdd474181fffabd33934.zip
Fix the problem when -L is used with IPv6 addresses. Don't try to
connect on port 139 with IPv6. Found by David Holder @ Erion. Karolin please merge to 3.2-stable. Jeremy. (This used to be commit c003e66ff10b23bb30aef0071ba7a3ae9579174e)
-rw-r--r--source3/client/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 882ed4dbdd..276ffb93d8 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4514,6 +4514,8 @@ static int process(const char *base_directory)
static int do_host_query(const char *query_host)
{
+ struct sockaddr_storage ss;
+
cli = cli_cm_open(talloc_tos(), NULL,
query_host, "IPC$", true, smb_encrypt);
if (!cli)
@@ -4521,6 +4523,12 @@ 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;
+ }
+
if (port != 139) {
/* Workgroups simply don't make sense over anything