if( vlc_thread_create( p_sap, "sap handler", RunThread,
VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) )
{
- msg_Dbg( p_announce, "Unable to spawn SAP handler thread");
+ msg_Dbg( p_announce, "unable to spawn SAP handler thread");
free( p_sap );
return NULL;
};
if( p_session->psz_uri == NULL )
{
vlc_mutex_unlock( &p_sap->object_lock );
- msg_Err( p_sap, "*FIXME* Unexpected NULL URI for SAP announce" );
+ msg_Err( p_sap, "*FIXME* unexpected NULL URI for SAP announce" );
msg_Err( p_sap, "This should not happen. VLC needs fixing." );
return VLC_EGENERIC;
}
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;
}
p_sap->i_sessions,
p_sap->i_sessions,
p_sap_session );
- msg_Dbg( p_sap,"Addresses: %i Sessions: %i",
+ msg_Dbg( p_sap,"%i addresses, %i sessions",
p_sap->i_addresses,p_sap->i_sessions);
/* Remember the SAP session for later deletion */
if( p_session->i_next < mdate() )
{
#ifdef EXTRA_DEBUG
- msg_Dbg( p_sap, "Sending announce");
+ msg_Dbg( p_sap, "sending announce");
#endif
i_ret = net_Write( p_sap, p_session->p_address->i_wfd, NULL,
p_session->psz_data,
"%s%s%s",
i_sdp_id, i_sdp_version,
ipv, p_addr->psz_machine,
- psz_name, ipv, psz_uri, p_session->i_ttl,
+ psz_name, ipv, psz_uri,
+ /* FIXME: 1 is IPv4 default TTL, not that of IPv6 */
+ p_session->i_ttl ?: (config_GetInt( p_sap, "ttl" ) ?: 1),
p_session->i_port,
p_session->b_rtp ? "RTP/AVP" : "udp",
p_session->i_payload,
p_address->i_interval = MAX_INTERVAL;
}
#ifdef EXTRA_DEBUG
- msg_Dbg( p_sap,"%s:%i : Rate=%i, Interval = %i s",
+ msg_Dbg( p_sap,"%s:%i: rate=%i, interval = %i s",
p_address->psz_address,SAP_PORT, i_rate, p_address->i_interval );
#endif