1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Simplify net_accept() with UDP sockets

This is made possible by the new API where net_accept() gets a pointer to
bind_ctx, so it can update it.
This commit is contained in:
Manuel Pégourié-Gonnard
2015-07-01 01:28:24 +02:00
parent db2468d7aa
commit abc729e664
6 changed files with 26 additions and 48 deletions

View File

@ -273,13 +273,6 @@ reset:
goto exit;
}
/* With UDP, bind_fd is hijacked by client_fd, so bind a new one */
if( ( ret = mbedtls_net_bind( &listen_fd, NULL, "4433", MBEDTLS_NET_PROTO_UDP ) ) != 0 )
{
printf( " failed\n ! mbedtls_net_bind returned -0x%x\n\n", -ret );
goto exit;
}
/* For HelloVerifyRequest cookies */
if( ( ret = mbedtls_ssl_set_client_transport_id( &ssl,
client_ip, cliip_len ) ) != 0 )