-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketUtil: explicitly set V6ONLY socket option #712
base: master
Are you sure you want to change the base?
Conversation
I thought of doing this a few times, but didn't because I didn't want to override the admin's global setting for this. By default, MPD should be a good citizen and should follow global configuration. |
I think the amount of people doing that is close to zero. Besides, if you bind a socket to a specific IPv6 address through a software configuration option I would not expect the software to create an IPv4 socket as well. Also keep in mind that this only works for
I don't think that this is a popular interpretation of |
This needs to be rebased to pass Travis. |
6a8c4e3
to
65b4c5e
Compare
Rebased and fixed the build on Mac OS. |
MPD seems to only support Linux and Mac OS currently. The IPV6_V6ONLY socket option is supported by both of these operating systems. Regarding Mac OS X, consult the ip6(4) man page for more information.
Currently, MPD emits the following warning on Linux when `net.ipv6.bindv6only` is set to the default value zero: exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use This is a known issues (MusicPlayerDaemon#673, MusicPlayerDaemon#557, …) caused by the fact that MPD, by default, creates separate sockets for `AF_INET` and `AF_INET6`. With this architecture it is not necessary to use the `AF_INET6` socket for both IPv6 and IPv4. For this reason, explicitly enable the V6ONLY socket option for `AF_INET6` sockets, thereby preventing the error causing the warning to be emitted.
Currently, MPD emits the following warning on Linux when
net.ipv6.bindv6only
is set to the default value zero:This is a known issues (#673, #557, …) caused by the fact that MPD, by
default, creates separate sockets for
AF_INET
andAF_INET6
. Withthis architecture it is not necessary to use the
AF_INET6
socket forboth IPv6 and IPv4. For this reason, explicitly enable the V6ONLY
socket option for
AF_INET6
sockets, thereby preventing the errorcausing the warning to be emitted.