The Samba-Bugzilla – Bug 6359
smbclient -L does not list workgroup for hosts with both IPv4 and IPv6 addresses
Last modified: 2010-02-07 10:01:50 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
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
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.
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
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.
Patch applied for 3.4. Thanks.
Can someone review for possible 3.3 and 3.2 inclusion ?
Hmmm. How do I reproduce this, so that I can test the patch? (Never have used IPv6 so far...) :-)
Volker, I'll email you directly with some IPv6 setup info. Ole
Patch has been applied, closing as fixed.