Commit c46a622a authored by Sebastien Escudier's avatar Sebastien Escudier Committed by Rémi Denis-Courmont

Allow 0 TTL

Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent c4bf02fb
...@@ -108,7 +108,7 @@ static int Activate( vlc_object_t *p_this ) ...@@ -108,7 +108,7 @@ static int Activate( vlc_object_t *p_this )
msg_Err( p_intf, "master address not specified" ); msg_Err( p_intf, "master address not specified" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
fd = net_ConnectUDP( VLC_OBJECT(p_intf), psz_master, NETSYNC_PORT, 0 ); fd = net_ConnectUDP( VLC_OBJECT(p_intf), psz_master, NETSYNC_PORT, -1 );
free( psz_master ); free( psz_master );
} }
else else
......
...@@ -712,7 +712,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -712,7 +712,7 @@ static int Open( vlc_object_t *p_this )
if( i_port <= 0 ) i_port = 1234; if( i_port <= 0 ) i_port = 1234;
msg_Dbg( p_demux, "resend ts to '%s:%d'", val.psz_string, i_port ); msg_Dbg( p_demux, "resend ts to '%s:%d'", val.psz_string, i_port );
p_sys->fd = net_ConnectUDP( VLC_OBJECT(p_demux), val.psz_string, i_port, 0 ); p_sys->fd = net_ConnectUDP( VLC_OBJECT(p_demux), val.psz_string, i_port, -1 );
if( p_sys->fd < 0 ) if( p_sys->fd < 0 )
{ {
msg_Err( p_demux, "failed to open udp socket, send disabled" ); msg_Err( p_demux, "failed to open udp socket, send disabled" );
......
...@@ -289,7 +289,7 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset ) ...@@ -289,7 +289,7 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset )
p_data[i_offset++] = (md5.p_digest[i]>>24)&0xFF; p_data[i_offset++] = (md5.p_digest[i]>>24)&0xFF;
} }
i_handle = net_ConnectUDP( p_this, psz_server, i_port, 0 ); i_handle = net_ConnectUDP( p_this, psz_server, i_port, -1 );
if( i_handle == -1 ) if( i_handle == -1 )
{ {
msg_Err( p_this, "failed to open a connection (udp)" ); msg_Err( p_this, "failed to open a connection (udp)" );
......
...@@ -642,7 +642,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, ...@@ -642,7 +642,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
int i_val, i_handle = -1; int i_val, i_handle = -1;
bool b_unreach = false; bool b_unreach = false;
if( i_hlim < 1 ) if( i_hlim < 0 )
i_hlim = var_CreateGetInteger( p_this, "ttl" ); i_hlim = var_CreateGetInteger( p_this, "ttl" );
memset( &hints, 0, sizeof( hints ) ); memset( &hints, 0, sizeof( hints ) );
...@@ -676,7 +676,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, ...@@ -676,7 +676,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
setsockopt (fd, SOL_SOCKET, SO_BROADCAST, &(int){ 1 }, sizeof (int)); setsockopt (fd, SOL_SOCKET, SO_BROADCAST, &(int){ 1 }, sizeof (int));
#endif #endif
if( i_hlim > 0 ) if( i_hlim >= 0 )
net_SetMcastHopLimit( p_this, fd, ptr->ai_family, i_hlim ); net_SetMcastHopLimit( p_this, fd, ptr->ai_family, i_hlim );
str = var_CreateGetNonEmptyString (p_this, "miface"); str = var_CreateGetNonEmptyString (p_this, "miface");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment