Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error handling when connection closed by peer
We checked for zero read when reading the packet but not when reading the header, so we tried to read zero bytes from the closed socket (which succeeds), and then tried to write zero length packet to vmnet, which fails with VMNET_INVALID_ARGUMENT: Example logs (from my logging branch): ERROR| accept: Interrupted system call ERROR| vmnet_write: [1003] VMNET_INVALID_ARGUMENT INFO | Closing a connection (fd 5) ERROR| writev: Bad file descriptor ERROR| writev: Bad file descriptor ERROR| vmnet_write: [1003] VMNET_INVALID_ARGUMENT INFO | Closing a connection (fd 6) Now we check for zero read and log a clear message: Connection closed by peer (fd 5) Signed-off-by: Nir Soffer <[email protected]>
- Loading branch information