From: RĂ©mi Denis-Courmont Date: Tue, 28 Feb 2006 14:52:40 +0000 (+0000) Subject: Fail when trying to advertise a stream with an out-of-scope address X-Git-Tag: 0.9.0-test0~12128 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ed07de3e8469dd5ada15d8aa9700d807e43e999c;p=vlc Fail when trying to advertise a stream with an out-of-scope address (avoids spamming the MBONE with incorrect private streams) --- diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c index c733cf6af1..7a354f1b54 100644 --- a/src/stream_output/sap.c +++ b/src/stream_output/sap.c @@ -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; }