diff options
| author | Anshu Kumari <anskuma@redhat.com> | 2026-04-23 11:53:14 +0530 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-04-24 23:35:43 +0200 |
| commit | ec96f0124282338cd2b2e65ff1aa3def8882ae23 (patch) | |
| tree | 90468d75d4344bde0c1a66e473c2a871d3123575 /test | |
| parent | a287375874f4f6269ed2ec833394d22ebac26a5a (diff) | |
| download | passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar.gz passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar.bz2 passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar.lz passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar.xz passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.tar.zst passt-ec96f0124282338cd2b2e65ff1aa3def8882ae23.zip | |
tcp: Handle errors from tcp_send_flag()
tcp_send_flag() can fail in two different ways:
- tcp_prepare_flags() returns -ECONNRESET when getsockopt(TCP_INFO)
fails: the socket is broken and the connection must be reset.
- tcp_vu_send_flag() returns -EAGAIN when vu_collect() finds no
available vhost-user buffers: this is a transient condition
equivalent to a dropped packet on the wire.
Have tcp_vu_send_flag() return -EAGAIN instead of a bare -1 for the
buffer-unavailable case. Absorb -EAGAIN in the tcp_send_flag()
dispatcher so that callers only see fatal errors.
Check the return value at each call site and handle fatal errors:
- in tcp_data_from_tap(), return -1 so the caller resets
- in tcp_tap_handler(), goto reset
- in tcp_timer_handler()/tcp_sock_handler()/tcp_conn_from_sock_finish(),
call tcp_rst() and return
- in tcp_tap_conn_from_sock(), set CLOSING flag, call
FLOW_ACTIVATE() to avoid leaving the flow in TYPED state, and
return
- in tcp_connect_finish(), call tcp_rst() and return
- in tcp_keepalive(), call tcp_rst() and continue the loop
- in tcp_flow_migrate_target_ext(), goto fail
The call in tcp_rst_do() is left unchecked: we are already
resetting, and tcp_sock_rst() still needs to run regardless.
Link: https://bugs.passt.top/show_bug.cgi?id=194
Signed-off-by: Anshu Kumari <anskuma@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
