From 3fdfcedebb222643935e06e6e4712c481c3282ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 23 Oct 2014 15:23:48 +0200 Subject: [PATCH] Fix net_accept() regarding non-blocking sockets --- ChangeLog | 1 + library/net.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index deddb4c0e..9d0821c7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Bugfix * x509_crt_parse() did not increase total_failed on PEM error * Fix compiler warnings on iOS (found by Sander Niemeijer). * Don't print uninitialised buffer in ssl_mail_client (found by Marc Abel). + * Fix net_accept() regarding non-blocking sockets (found by Luca Pesce). Changes * X.509 certificates with more than one AttributeTypeAndValue per diff --git a/library/net.c b/library/net.c index 899cf3743..bfe08fb73 100644 --- a/library/net.c +++ b/library/net.c @@ -282,7 +282,7 @@ int net_accept( int bind_fd, int *client_fd, void *client_ip ) if( *client_fd < 0 ) { - if( net_would_block( *client_fd ) != 0 ) + if( net_would_block( bind_fd ) != 0 ) return( POLARSSL_ERR_NET_WANT_READ ); return( POLARSSL_ERR_NET_ACCEPT_FAILED );