smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.64k stars 404 forks source link

Change `phy::RawSocket` to open the underlying socket with `O_NONBLOCK` #817

Closed ritikmishra closed 11 months ago

ritikmishra commented 11 months ago

phy::RawSocket is written in a way assuming that the underlying socket is nonblocking (e.g receive checks for io::ErrorKind::WouldBlock here). However, the socket was not being opened in a nonblocking mode.

I found this by trying to use phy::RawSocket to test some larger chunk of smoltcp-using code on macOS -- the first call to iface.poll(...) blocked indefinitely.

codecov[bot] commented 11 months ago

Codecov Report

Merging #817 (ab214a6) into main (f9b064a) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #817   +/-   ##
=======================================
  Coverage   79.65%   79.65%           
=======================================
  Files          72       72           
  Lines       27862    27862           
=======================================
  Hits        22193    22193           
  Misses       5669     5669           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more