aboutgitcodebugslistschat
path: root/tcp_buf.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-07-24 13:31:09 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-07-24 09:27:46 +0200
commita09aeb4bd600fcb92d0341fd51858e6cee0bbea4 (patch)
treed2761fdf6c954c7c991b81cd3446ab6d90460fdc /tcp_buf.h
parent9cb6b508157a92bc0c5c0f71d6b3d09a628a0766 (diff)
downloadpasst-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar.gz
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar.bz2
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar.lz
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar.xz
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.tar.zst
passt-a09aeb4bd600fcb92d0341fd51858e6cee0bbea4.zip
tcp: Correctly update SO_PEEK_OFF when tcp_send_frames() drops frames
When using the new SO_PEEK_OFF feature on TCP sockets, we must adjust the SO_PEEK_OFF value whenever we move conn->seq_to_tap backwards. Although it was discussed during development, somewhere during the shuffles the case where we move the pointer backwards because we lost frames while sending them to the guest. This can happen, for example, if the socket buffer on the Unix socket to qemu overflows. Fixing this is slightly complicated because we need to pass a non-const context pointer to some places we previously didn't need it. While we're there also fix a small stylistic issue in the function comment for tcp_revert_seq() - it was using spaces instead of tabs. Fixes: e63d281871ef ("tcp: leverage support of SO_PEEK_OFF socket option when available") Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_buf.h')
-rw-r--r--tcp_buf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp_buf.h b/tcp_buf.h
index 14be7b9..3db4c56 100644
--- a/tcp_buf.h
+++ b/tcp_buf.h
@@ -9,7 +9,7 @@
void tcp_sock4_iov_init(const struct ctx *c);
void tcp_sock6_iov_init(const struct ctx *c);
void tcp_flags_flush(const struct ctx *c);
-void tcp_payload_flush(const struct ctx *c);
+void tcp_payload_flush(struct ctx *c);
int tcp_buf_data_from_sock(struct ctx *c, struct tcp_tap_conn *conn);
int tcp_buf_send_flag(struct ctx *c, struct tcp_tap_conn *conn, int flags);