From ed07de3e8469dd5ada15d8aa9700d807e43e999c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 28 Feb 2006 14:52:40 +0000 Subject: [PATCH] Fail when trying to advertise a stream with an out-of-scope address (avoids spamming the MBONE with incorrect private streams) --- src/stream_output/sap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } -- 2.39.5