mbedtls: mbedlts_net_bind should bind on all interfaces with bind_ip == NULL

As per mbedtls documentation. This is different to lwip_getaddrinfo()
which uses loopback for a NULL address.

Fixes bug mentioned here https://groups.google.com/forum/#!topic/esp-open-rtos/3KH5TZSTMUw
This commit is contained in:
Angus Gratton 2016-02-09 10:54:57 +11:00
parent e2759f9e7d
commit 3dfa2272cc
2 changed files with 34 additions and 10 deletions

View file

@ -158,7 +158,7 @@ void tls_server_task(void *pvParameters)
/*
* 1. Start the connection
*/
ret = mbedtls_net_bind(&server_ctx, "0.0.0.0", PORT, MBEDTLS_NET_PROTO_TCP);
ret = mbedtls_net_bind(&server_ctx, NULL, PORT, MBEDTLS_NET_PROTO_TCP);
if(ret != 0)
{
printf(" failed\n ! mbedtls_net_bind returned %d\n\n", ret);