Index: gstmultiudpsink.c
===================================================================
--- gstmultiudpsink.c	(revision 32)
+++ gstmultiudpsink.c	(working copy)
@@ -105,9 +105,12 @@
 };
 
 #define CLOSE_IF_REQUESTED(udpctx)                                        \
-  if ((!udpctx->externalfd) || (udpctx->externalfd && udpctx->closefd))   \
+  if ((!udpctx->externalfd) || (udpctx->externalfd && udpctx->closefd)) { \
     CLOSE_SOCKET(udpctx->sock);                                           \
-  udpctx->sock = -1;
+    CLOSE_SOCKET(udpctx->sock6);                                          \
+  }                                                                       \
+  udpctx->sock = -1;                                                      \
+  udpctx->sock6 = -1;
 
 static void gst_multiudpsink_base_init (gpointer g_class);
 static void gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass);
@@ -333,6 +336,7 @@
 
   sink->client_lock = g_mutex_new ();
   sink->sock = -1;
+  sink->sock6 = -1;
   sink->sockfd = DEFAULT_SOCKFD;
   sink->closefd = DEFAULT_CLOSEFD;
   sink->externalfd = (sink->sockfd != -1);
@@ -601,15 +605,19 @@
   GstUDPClient *client;
 
   if (sink->sockfd == -1) {
-    /* create sender socket try IP6, fall back to IP4 */
-    if ((sink->sock = socket (AF_INET6, SOCK_DGRAM, 0)) == -1)
-      if ((sink->sock = socket (AF_INET, SOCK_DGRAM, 0)) == -1)
-        goto no_socket;
+    /* create sender socket for IP4 and try for IP6 */
+    if ((sink->sock = socket (AF_INET, SOCK_DGRAM, 0)) == -1)
+      goto no_socket;
+    /* FIXME: should we just ignore the error or check if 
+     * its protocol no supported?
+     */
+    sink->sock6 = socket (AF_INET6, SOCK_DGRAM, 0);
 
     sink->externalfd = FALSE;
   } else {
     /* we use the configured socket */
     sink->sock = sink->sockfd;
+    /* FIXME: need external socket for IP6 */
     sink->externalfd = TRUE;
   }
 
@@ -618,11 +626,16 @@
           setsockopt (sink->sock, SOL_SOCKET, SO_BROADCAST, &bc_val,
               sizeof (bc_val))) < 0)
     goto no_broadcast;
+  if (sink->sock6 != -1 && (ret =
+          setsockopt (sink->sock6, SOL_SOCKET, SO_BROADCAST, &bc_val,
+              sizeof (bc_val))) < 0)
+    goto no_broadcast;
 
   sink->bytes_to_serve = 0;
   sink->bytes_served = 0;
 
   gst_udp_set_loop_ttl (sink->sock, sink->loop, sink->ttl);
+  gst_udp_set_loop_ttl (sink->sock6, sink->loop, sink->ttl);
   gst_multiudpsink_setup_qos_dscp (sink);
 
   /* look for multicast clients and join multicast groups approptiately */
@@ -667,11 +680,16 @@
   client = g_new0 (GstUDPClient, 1);
   client->host = g_strdup (host);
   client->port = port;
-  client->sock = &sink->sock;
 
   if (gst_udp_get_addr (host, port, &client->theiraddr) < 0)
     goto getaddrinfo_error;
 
+  /* point the client to the correct IP version socket */
+  if (client->theiraddr.ss_family == AF_INET6)
+    client->sock = &sink->sock6;
+  else
+    client->sock = &sink->sock;
+
   g_get_current_time (&now);
   client->connect_time = GST_TIMEVAL_TO_TIME (now);
 
Index: gstmultiudpsink.h
===================================================================
--- gstmultiudpsink.h	(revision 32)
+++ gstmultiudpsink.h	(working copy)
@@ -58,6 +58,7 @@
   GstBaseSink parent;
 
   int sock;
+  int sock6;
 
   GMutex        *client_lock;
   GList         *clients;
