After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767055 - Allow listening on IPv4/IPv6 for the same socket
Allow listening on IPv4/IPv6 for the same socket
Status: RESOLVED INVALID
Product: libsoup
Classification: Core
Component: API
2.54.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2016-05-31 09:23 UTC by Bastien Nocera
Modified: 2016-05-31 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2016-05-31 09:23:07 UTC
Under Linux, unless the socket is set to IPV6_V6ONLY, listening to 0.0.0.0 on IPv4 will also listen on the same socket (and port) for IPv6.

See:
https://lwn.net/SubscriberLink/688462/08fa7baf32c0869b/

This would make it easier for cases like bug 766723, where we want to listen for IPv4 and IPv6 requests on the same port.
Comment 1 Dan Winship 2016-05-31 13:09:07 UTC
I thought bug 766723 was just about the fact that DAAP and DACP use the same port and so you are trying to bind exactly the same port twice, and so IPv4 vs IPv6 doesn't matter at all?

What exactly do you think would be happening differently if libsoup wasn't setting IPV6_V6ONLY?


IPv6-mapped IPv4 is a bad idea, both for security reasons as described in the LWN article, and because it's not portable.
Comment 2 Dan Winship 2016-05-31 13:10:44 UTC
Note that you *can* listen for both IPv4 and IPv6 on the same port; in fact, with the new SoupServer APIs, you have to pass an option if you *don't* want to do that.
Comment 3 Bastien Nocera 2016-05-31 13:11:27 UTC
(In reply to Dan Winship from comment #1)
> I thought bug 766723 was just about the fact that DAAP and DACP use the same
> port and so you are trying to bind exactly the same port twice, and so IPv4
> vs IPv6 doesn't matter at all?

You're completely right. I read the article, and thought "hey, this is the same problem". It isn't.

> What exactly do you think would be happening differently if libsoup wasn't
> setting IPV6_V6ONLY?
> 
> 
> IPv6-mapped IPv4 is a bad idea, both for security reasons as described in
> the LWN article, and because it's not portable.

Fair enough.