diff --git a/libraries/Ethernet/utility/socket.cpp b/libraries/Ethernet/utility/socket.cpp index f717c0fcb..03ff8504c 100644 --- a/libraries/Ethernet/utility/socket.cpp +++ b/libraries/Ethernet/utility/socket.cpp @@ -151,7 +151,7 @@ uint16_t recv(SOCKET s, uint8_t *buf, uint16_t len) { // No data available. uint8_t status = W5100.readSnSR(s); - if ( s == SnSR::LISTEN || s == SnSR::CLOSED || s == SnSR::CLOSE_WAIT ) + if ( status == SnSR::LISTEN || status == SnSR::CLOSED || status == SnSR::CLOSE_WAIT ) { // The remote end has closed its side of the connection, so this is the eof state ret = 0;