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 522519 - soup-server ipv6 support
soup-server ipv6 support
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2008-03-14 22:02 UTC by Colin Leroy
Modified: 2014-05-02 13:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Leroy 2008-03-14 22:02:55 UTC
It would be nice if soup-server could listen on ipv6 addresses too.
Comment 1 Dan Winship 2008-03-14 22:59:42 UTC
You *can* listen on ipv6 if you tell it to explicitly. Instead of doing:

    server = soup_server_new (SOUP_SERVER_PORT, port,
                              NULL);

do

    addr = soup_address_new (SOUP_ADDRESS_FAMILY_IPV6, port);
    server = soup_server_new (SOUP_SERVER_INTERFACE, addr,
                              NULL);
    g_object_unref (addr);

However, it would be nice if there was an easier way. It should probably also be possible to have a single SoupServer listening on multiple ports, so that you can have one SoupServer serving both IPv4 and IPv6, rather than needing two servers with the same handlers attached to them. (This could also be used to enable http and https from a single server.)
Comment 2 Colin Leroy 2008-03-15 07:58:40 UTC
Oh, sorry. I think it's an enhancement, then. :)
Comment 3 Guillaume Desmottes 2009-01-30 15:09:13 UTC
I agree. Such feature would be very nice.
Comment 4 coolbuddy 2010-11-20 17:07:29 UTC
Dear Dan,

libsoup cannot listen on IPv6 link local address. This bug is mostly because GSocketAddress does not have a field for "sin6_scope_id" to fill in interface index (as stated in man 7 ipv6).

Libsoup is used in GUPnP. UPnP standard requires to support link local addresses as well. I was wondering how to proceed further.

How to go about solving this one?

Regards,
VJ
Comment 5 Dan Winship 2014-05-02 13:19:06 UTC
fixed in git master

(In reply to comment #1)
> However, it would be nice if there was an easier way. It should probably also
> be possible to have a single SoupServer listening on multiple ports, so that
> you can have one SoupServer serving both IPv4 and IPv6, rather than needing two
> servers with the same handlers attached to them. (This could also be used to
> enable http and https from a single server.)

This is possible via the new soup_server_listen_* APIs. Eg, to listen on port 9999 on localhost on both IPv4 and IPv6, do:

    soup_server_listen_local (server, 9999, 0, &error);

or for just IPv6:

    soup_server_listen_local (server, 9999, SOUP_SERVER_LISTEN_IPV6_ONLY, &error);

(In reply to comment #4)
> libsoup cannot listen on IPv6 link local address. This bug is mostly because
> GSocketAddress does not have a field for "sin6_scope_id" to fill in interface
> index (as stated in man 7 ipv6).

GInetSocketAddress was fixed a while back to support scope_id. So to do this, you can now create a GInetSocketAddress with the appropriate scope_id, and then pass that address to soup_server_listen()