Reverse order of IPv6/IPv4 binding to handle systems without IPV6_V6ONLY.
authorPierre Ossman <ossman@cendio.se>
Wed, 19 Apr 2006 07:31:11 +0000 (07:31 +0000)
committerPierre Ossman <ossman@cendio.se>
Wed, 19 Apr 2006 07:31:11 +0000 (07:31 +0000)
System that always do IPV6_V6ONLY will now still bind to both sockets, just
in another order.

System that never do IPV6_V6ONLY will now fail to bind IPv4 instead of IPv6.
But since they force IPv6 sockets to accept IPv4 connections, everything is
peachy anyway.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@756 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/modules/module-protocol-stub.c

index 2f022b9..0ffd81d 100644 (file)
@@ -211,14 +211,14 @@ int pa__init(pa_core *c, pa_module*m) {
     listen_on = pa_modargs_get_value(ma, "listen", NULL);
 
     if (listen_on) {
-        s_ipv4 = pa_socket_server_new_ipv4_string(c->mainloop, listen_on, port, TCPWRAP_SERVICE);
         s_ipv6 = pa_socket_server_new_ipv6_string(c->mainloop, listen_on, port, TCPWRAP_SERVICE);
+        s_ipv4 = pa_socket_server_new_ipv4_string(c->mainloop, listen_on, port, TCPWRAP_SERVICE);
     } else if (loopback) {
-        s_ipv4 = pa_socket_server_new_ipv4_loopback(c->mainloop, port, TCPWRAP_SERVICE);
         s_ipv6 = pa_socket_server_new_ipv6_loopback(c->mainloop, port, TCPWRAP_SERVICE);
+        s_ipv4 = pa_socket_server_new_ipv4_loopback(c->mainloop, port, TCPWRAP_SERVICE);
     } else {
-        s_ipv4 = pa_socket_server_new_ipv4_any(c->mainloop, port, TCPWRAP_SERVICE);
         s_ipv6 = pa_socket_server_new_ipv6_any(c->mainloop, port, TCPWRAP_SERVICE);
+        s_ipv4 = pa_socket_server_new_ipv4_any(c->mainloop, port, TCPWRAP_SERVICE);
     }
 
     if (!s_ipv4 && !s_ipv6)