]> git.sesse.net Git - vlc/commitdiff
Fail when trying to advertise a stream with an out-of-scope address
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 28 Feb 2006 14:52:40 +0000 (14:52 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 28 Feb 2006 14:52:40 +0000 (14:52 +0000)
(avoids spamming the MBONE with incorrect private streams)

src/stream_output/sap.c

index c733cf6af1d798967adf5461a41257b87b869eb0..7a354f1b540dc5511946e6e2acca0d2565135294 100644 (file)
@@ -317,9 +317,21 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
             if ((ipv4 & 0xfffc0000) == 0xefc00000)
                 ipv4 =  0xefc3ffff;
             else
+            if ((ipv4 & 0xff000000) == 0xef000000)
+                ipv4 = 0;
+            else
             /* other addresses => 224.2.127.254 */
                 ipv4 = 0xe0027ffe;
 
+            if( ipv4 == 0 )
+            {
+                msg_Err( p_sap, "Out-of-scope multicast address "
+                        "not supported by SAP: %s", p_session->psz_uri );
+                vlc_mutex_unlock( &p_sap->object_lock );
+                vlc_freeaddrinfo( res );
+                return VLC_EGENERIC;
+            }
+
             ((struct sockaddr_in *)&addr)->sin_addr.s_addr = htonl( ipv4 );
             break;
         }