mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 12:04:16 +01:00
Check setsockopt() return value in net_bind()
This commit is contained in:
parent
7890e62a1f
commit
676093e253
@ -176,8 +176,12 @@ int net_bind( int *fd, const char *bind_ip, int port )
|
||||
return( POLARSSL_ERR_NET_SOCKET_FAILED );
|
||||
|
||||
n = 1;
|
||||
setsockopt( *fd, SOL_SOCKET, SO_REUSEADDR,
|
||||
(const char *) &n, sizeof( n ) );
|
||||
if( setsockopt( *fd, SOL_SOCKET, SO_REUSEADDR,
|
||||
(const char *) &n, sizeof( n ) ) != 0 )
|
||||
{
|
||||
close( *fd );
|
||||
return( POLARSSL_ERR_NET_SOCKET_FAILED );
|
||||
}
|
||||
|
||||
server_addr.sin_addr.s_addr = net_htonl( INADDR_ANY );
|
||||
server_addr.sin_family = AF_INET;
|
||||
|
Loading…
Reference in New Issue
Block a user