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 349907 - multiudpsink messes up multicast addresses
multiudpsink messes up multicast addresses
Status: RESOLVED DUPLICATE of bug 346921
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-04 11:06 UTC by Marcel Moreaux
Modified: 2006-08-14 10:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
The patch for removing multi_addr and using client-client->multi_add>multi_addr instead (1.24 KB, patch)
2006-08-04 11:07 UTC, Marcel Moreaux
none Details | Review

Description Marcel Moreaux 2006-08-04 11:06:23 UTC
When using multiudpsink or udpsink (which uses multiudpsink), specifying a multicast address will cause multiudpsink to send the stream to apparently random addresses:


[marcelm@almaz ~]$ gst-launch dv1394src ! rtpdvpay ! udpsink host=233.4.117.16 port=8000
[root@almaz test]# tcpdump udp
12:40:47.189004 IP almaz.32798 > 112.145.153.187.8000: UDP, length 972
12:40:47.207319 IP almaz.32798 > 112.145.153.187.8000: UDP, length 972


[marcelm@almaz ~]$ gst-launch dv1394src ! rtpdvpay ! udpsink host=233.4.117.16 port=8000
[root@almaz test]# tcpdump udp
12:40:52.225061 IP almaz.32799 > 96.166.232.97.8000: UDP, length 972
12:40:52.243152 IP almaz.32799 > 96.166.232.97.8000: UDP, length 972



[marcelm@almaz ~]$ gst-launch dv1394src ! rtpdvpay ! udpsink host=233.4.117.16 port=8000
[root@almaz test]# tcpdump udp
12:40:57.024684 IP almaz.32800 > 16.29.84.211.8000: UDP, length 972
12:40:57.263074 IP almaz.32800 > 16.29.84.211.8000: UDP, length 972


Etc.

The problem is in the gst_multiudpsink_add() function in gstmultiudpsink.c (in gst-plugins-good). There, in the multicast special case the following happens:

      client->multi_addr.imr_multiaddr.s_addr = addr.s_addr;
      client->multi_addr.imr_interface.s_addr = INADDR_ANY;

      client->theiraddr.sin_addr = multi_addr.imr_multiaddr;

      setsockopt (sink->sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &multi_addr,
          sizeof (multi_addr));

There are two diffent struct ip_mreq instances here: multi_addr and client->multi_addr. Of these, client->multi_addr is initialized but apparently unused, and multi_addr is *not* initialized but used (the garbage in the uninitialized multi_addr is what leads to the semi-random addresses).

It seems to me that the local multi_addr is completely unnessecary, and its current usage is erroneous. If my understanding is correct, the multi_addr should be removed, and everything should use client->multi_addr instead.

A patch for removing multi_addr and using client->multi_addr instead follows. The patch works fine in my limited testing.
Comment 1 Marcel Moreaux 2006-08-04 11:07:45 UTC
Created attachment 70191 [details] [review]
The patch for removing multi_addr and using client-client->multi_add>multi_addr instead
Comment 2 Wim Taymans 2006-08-09 10:39:32 UTC
Was fixed (and more) with patch in bug #346921.

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