GNOME Bugzilla – Bug 630894
udpsink fails to send data on IPv4 networks if IPv6 is enabled...
Last modified: 2013-04-25 10:30:25 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)
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 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)
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.
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))
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 ***