diff options
| author | David du Colombier <0intro@gmail.com> | 2026-06-16 18:37:05 +0200 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-06-19 13:10:24 +0200 |
| commit | f072bc07b8251e513823cbb08c69a336187ec56c (patch) | |
| tree | 9f433b6d946fe5c57a9675de67ed335a0ebba8f7 /test/tcp/git: | |
| parent | 41566e16fe95b856067c044d74928fa930a9e269 (diff) | |
| download | passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar.gz passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar.bz2 passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar.lz passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar.xz passt-f072bc07b8251e513823cbb08c69a336187ec56c.tar.zst passt-f072bc07b8251e513823cbb08c69a336187ec56c.zip | |
tap: Trim Ethernet padding from short IPv4 frames instead of dropping them
tap4_handler() requires the L2 payload after the IP header to match
the IP datagram length exactly. Guests whose drivers pad transmitted
frames to the 60 byte Ethernet minimum, as real hardware requires and
as drivers modelled on hardware do (Plan 9's virtio-net, for one),
send pure ACK and FIN segments as 60 byte frames: 14 byte Ethernet
header, 40 byte IPv4 datagram, 6 padding octets. Those frames fail
the exact length check and are dropped without trace.
passt then never sees such a guest's acknowledgements: it
retransmits from the lowest unacknowledged sequence with exponential
backoff while the guest, which received and acknowledged everything,
waits. Every fresh connection stalls for minutes (a 1 MiB HTTP fetch
over --map-host-loopback measured 248 s before this change, 0.27 s
after; bulk transfer over established connections, whose ACKs ride
data segments above the padding threshold, is unaffected). FIN
segments are padded too, so teardown hangs as well. Note that
tap_send_single() pads passt's own outbound frames to ETH_ZLEN, so
the receive path was already stricter than the send path.
Trim the trailing padding to the IP datagram length instead, using a
new iov_tail_trim() helper, and keep dropping frames genuinely
shorter than the datagram they claim to carry. IPv6 is unaffected:
its minimal TCP frame is 74 bytes, above the padding threshold.
Signed-off-by: David du Colombier <0intro@gmail.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/tcp/git:')
0 files changed, 0 insertions, 0 deletions
