You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used external package (tcpproxy) for proxying between unix stream and
datagram sockets. This package cannot handle ENOBUFS error, expected
condition on BSD based systems, and worse, it hides errors and stop
forwarding packets silently when write to vz socket fails with
ENOBUFS[1].
Fix the issues by replacing tcpproxy with a simpler and more direct
implementation that will be easier to maintain.
Fixes:
- Fix error handling if write to vz datagram socket fail with ENOBUFS.
We retry the write until it succeeds with a very short sleep between
retries. Similar solution is used in gvisor-tap-vsock[2].
- Fix error handling if we could not read packet header or body from
socket_vmnet stream socket. Previously we logged an error and continue
to send corrupted packet to vz from the point of the failure.
- Fix error handling if writing a packet to socket_vmnet stream socket
returned after writing partial packet. Now we handle short writes and
write the complete packet. Previously would break the protocol and
continue to send corrupted packet from the point of the failure.
- Log error if forwarding packets from vz to socket_vmnet or from
socket_vmnet to vz failed.
Simplification:
- Use binary.Read() and binary.Write() to read and write qemu packet
header.
Visibility:
- Make QEMUPacketConn private since it is an implementation detail of vz
when using socket_vmnet.
Testing:
- Add a packet forwarding test covering the happy path in 10
milliseconds.
[1] lima-vm/socket_vmnet#39
[2] containers/gvisor-tap-vsock#370
Signed-off-by: Nir Soffer <[email protected]>
0 commit comments