Bug 984243

Summary: smaba must not start with ipv6 sockets on non-ipv6 machines
Product: [Fedora] Fedora Reporter: Harald Reindl <h.reindl>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: abokovoy, asn, gdeschner, jlayton, sbose, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-16 12:51:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Reindl 2013-07-13 23:29:06 UTC
why does samba claim to listen on non existing ipv6 sockets?
ifconfig doe snot show any interface with a ipv6 address

[root@srv-rhsoft:~]$ netstat -l | grep smb
tcp   0  0 0.0.0.0:139    0.0.0.0:*   LISTEN      17788/smbd
tcp   0  0 0.0.0.0:445    0.0.0.0:*   LISTEN      17788/smbd
tcp6  0  0 :::139         :::*        LISTEN      17788/smbd
tcp6  0  0 :::445         :::*        LISTEN      17788/smbd

[root@srv-rhsoft:~]$ cat /etc/sysctl.conf | grep ipv6
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.all.accept_redirects=0
net.ipv6.conf.all.accept_source_route=0
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.default.accept_redirects=0
net.ipv6.conf.default.accept_source_route=0

Comment 1 Alexander Bokovoy 2013-07-15 06:21:53 UTC
From man ipv6(7):

...
IPv4  connections  can  be handled with the v6 API by using the v4-mapped-on-v6 address type; thus a program only needs to support this API type to support both protocols.  This is handled transparently by the address handling functions in the C library.

IPv4 and IPv6 share the local port space.  When you get an IPv4 connection or packet to a IPv6 socket, its source address will be mapped to v6  and it will be mapped to v6.
...

Samba internally creates sockets using IPv6 format as this is recommended way to handle both types of connections. The same is done by many of network applications nowadays.