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 630894 - udpsink fails to send data on IPv4 networks if IPv6 is enabled...
udpsink fails to send data on IPv4 networks if IPv6 is enabled...
Status: RESOLVED DUPLICATE of bug 534243
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-29 11:53 UTC by IOhannes
Modified: 2013-04-25 10:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description IOhannes 2010-09-29 11:53:14 UTC
i'm running Debian(squeeze/sid) which as IPv6 turned on by default (which i believe is a good thing)

now, when udpsink creates a socket it first tries to create an IPv6 socket, and if that fails, it tries to create an IPv4 socket.
since IPv6 is enabled on my system, the returned socket is IPv6.

now when i try to send data to a remote host over an IPv4 network (because not the entire connection is IPv6 enabled we still use IPv4 by default), the "sendto" fails, as it tries to send an IPv4 packet over an IPv6 socket.

a quick and dirty workaround is, to disable IPv6 on the system, so udpsink can only create an IPv4 socket and everything works fine.

however, since IPv6 is becoming more frequent, i think it is not an option to turn off the IPv6 support of the system.

rather, udpsink should use IPv4 sockets to send IPv4 packets and IPv6 sockets to send IPv6 packets (yes, this probably means to open 2 sockets, one for IPv6 and one for IPv4 and use them accordingly)
Comment 1 Olivier Crête 2010-09-29 14:05:28 UTC
On Linux, you should be able to send ipv4 over an ipv6 socket unless you do setsockopt(IPV6_V6ONLY) on the port. So it sounds like maybe something is wrong with your system ?
Comment 2 IOhannes 2010-10-07 21:30:46 UTC
(In reply to comment #1)
> On Linux, you should be able to send ipv4 over an ipv6 socket unless you do
> setsockopt(IPV6_V6ONLY) on the port. So it sounds like maybe something is wrong
> with your system ?

in about each and every stock debian installation i have seen in the last few months, there is a file /etc/sysctl.d/bindv6only.conf with the following contents:

<snip>
# This sysctl sets the default value of the IPV6_V6ONLY socket option.
#
# When disabled, IPv6 sockets will also be able to send and receive IPv4
# traffic with addresses in the form ::ffff:192.0.2.1 and daemons listening
# on IPv6 sockets will also accept IPv4 connections.
#
# When IPV6_V6ONLY is enabled, daemons interested in both IPv4 and IPv6
# connections must open two listening sockets.
# This is the default behaviour of all modern operating systems.

net.ipv6.bindv6only = 1
</snip>

so i strongly believe that this is done on purpose, and with good reasons (debian being usually more concerned with network infrastructure than with multimedia)
Comment 3 Olivier Crête 2010-10-07 21:57:54 UTC
I guess we should force this flag to have a value of 0 with setsockopt, which is the default on Linux (which really is the only modern operating system I care about). Or I guess we can add a property to udpsrc/udpsink telling if its supposed ot use ipv4 or ipv6.. That would probably help for windows too.
Comment 4 IOhannes 2010-10-07 22:22:36 UTC
yes, this sounds like a good idea.

as for debian: after a bit of research, i find that there has endless discussion about this in bugreport #560238 for the offending package "netbase", which eventually led to the removal of this default option in the package (but it seems that systems that had installed the offending package are not "cleaned" again).
from the changelog:

  * Stop setting net.ipv6.bindv6only=1 by default. (Closes: #560238)

anyhow, i still think that it would be a good idea to use setsockopt to force the socket to be both ipv4&ipv6 (and eventually also add a property, so people can choose either ipv4, ipv6 or both (default))
Comment 5 Sebastian Dröge (slomo) 2013-04-25 10:30:25 UTC
Thanks for taking the time to report this bug.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade.

*** This bug has been marked as a duplicate of bug 534243 ***