]> git.sesse.net Git - vlc/commitdiff
Copy IPv4 multicast TTL from RTP to RTCP.
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 23 Feb 2009 16:24:58 +0000 (18:24 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 23 Feb 2009 16:31:46 +0000 (18:31 +0200)
We were sending RTCP with TTL=1 all the time...

modules/stream_out/rtcp.c

index cbc3dade8a96374c56197623868f763a28f7ae0b..3c1780e4e5bb4419de05c2acf3548fe3aa20b2f5 100644 (file)
@@ -99,6 +99,16 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
         dport++;
 
         fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, proto);
+
+        /* Copy the multicast IPv4 TTL value (useless for IPv6) */
+        if (fd != -1)
+        {
+            int ttl;
+            socklen_t len = sizeof (ttl);
+
+            if (!getsockopt (rtp_fd, SOL_IP, IP_MULTICAST_TTL, &ttl, &len))
+                setsockopt (fd, SOL_IP, IP_MULTICAST_TTL, &ttl, len);
+        }
     }
 
     if (fd == -1)