Bug 6359 - smbclient -L does not list workgroup for hosts with both IPv4 and IPv6 addresses
smbclient -L does not list workgroup for hosts with both IPv4 and IPv6 addresses
Status: RESOLVED FIXED
Product: Samba 3.3
Classification: Unclassified
Component: Client tools
3.3.4
Other Linux
: P3 normal
: ---
Assigned To: Volker Lendecke
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-14 12:49 UTC by Ole Hansen
Modified: 2010-02-07 10:01 UTC (History)
0 users

See Also:
jra: review+


Attachments
Proposed patch for IPv6 issue with smbclient hostquery (838 bytes, patch)
2009-05-14 12:56 UTC, Ole Hansen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Hansen 2009-05-14 12:49:35 UTC
In an IPv6-enabled Linux environment, smbclient -L servername does not list the server's workgroup if the server has both IPv6 and IPv4 DNS records. However, if instead of "servername" the server's IPv4 address is given explicitly, the workgroup list succeeds.

Steps to reproduce:
1) Set up an IPv4/IPv6-enabled local network and a samba workgroup
2) Give samba server machine both A and AAAA forward DNS records
3) List server shares with smbclient -L servername. Hit return at password prompt for anonymous login.
4) Repeat 3, but give server's explicit IPv4 address: smbclient -L 192.168.1.1

Actual results:
Step 3: Server shares are listed, but workgroup is not; instead an error is printed: "servername is an IPv6 address -- no workgroup available"
Step 4: Both shares and workgroup are listed

Expected results:
Workgroup should be listed in both steps 3 and 4, i.e. the client should properly resolve a host name to its IPv4 address if it exists, regardless of possible additional IPv6 addresses.

Tested with:
Samba 3.3.4 on Fedora 9

Also tested with:
Samba 3.2.11 on Fedora 9

Bug not observed with:
Samba 3.0.33 on RHEL5
Comment 1 Ole Hansen 2009-05-14 12:56:40 UTC
Created attachment 4156 [details]
Proposed patch for IPv6 issue with smbclient hostquery 

Here is a proposed patch for this bug. It tests if the given server host name resolves to (or literally is) an IPv4 address and, if so, proceeds without further ado. If not, the test for an IPv6 address is still done so that the user will get the "servername is an IPv6 address" error, but only for hosts that ONLY have an IPv6 address, as I think it should be.
Comment 2 Jeremy Allison 2009-05-15 18:19:07 UTC
Patch applied for 3.4. Thanks.
Can someone review for possible 3.3 and 3.2 inclusion ?
Jeremy.
Comment 3 Volker Lendecke 2009-05-16 01:38:06 UTC
Hmmm. How do I reproduce this, so that I can test the patch? (Never have used IPv6 so far...) :-)

Volker

Comment 4 Ole Hansen 2009-05-16 23:15:09 UTC
Volker, I'll email you directly with some IPv6 setup info. Ole

Comment 5 Volker Lendecke 2010-02-07 10:01:50 UTC
Patch has been applied, closing as fixed.