aboutgitcodebugslistschat
path: root/tcp_buf.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2024-09-18 15:13:28 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-09-18 17:15:28 +0200
commit8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e (patch)
tree31ff4e4c5c7cc9da2fe6edaa73d62b44a8769c87 /tcp_buf.c
parent4fe5f4e813b553f4877ffa2b485d941bb9f85ca2 (diff)
downloadpasst-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar.gz
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar.bz2
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar.lz
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar.xz
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.tar.zst
passt-8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e.zip
tcp: Allow checksum to be disabled
We can need not to set TCP checksum. Add a parameter to tcp_fill_headers4() and tcp_fill_headers6() to disable it. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_buf.c')
-rw-r--r--tcp_buf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tcp_buf.c b/tcp_buf.c
index 83f91a3..ffbff5e 100644
--- a/tcp_buf.c
+++ b/tcp_buf.c
@@ -320,7 +320,7 @@ int tcp_buf_send_flag(const struct ctx *c, struct tcp_tap_conn *conn, int flags)
return ret;
}
- l4len = tcp_l2_buf_fill_headers(conn, iov, optlen, NULL, seq);
+ l4len = tcp_l2_buf_fill_headers(conn, iov, optlen, NULL, seq, false);
iov[TCP_IOV_PAYLOAD].iov_len = l4len;
if (flags & DUP_ACK) {
@@ -381,7 +381,8 @@ static void tcp_data_to_tap(const struct ctx *c, struct tcp_tap_conn *conn,
tcp4_frame_conns[tcp4_payload_used] = conn;
iov = tcp4_l2_iov[tcp4_payload_used++];
- l4len = tcp_l2_buf_fill_headers(conn, iov, dlen, check, seq);
+ l4len = tcp_l2_buf_fill_headers(conn, iov, dlen, check, seq,
+ false);
iov[TCP_IOV_PAYLOAD].iov_len = l4len;
if (tcp4_payload_used > TCP_FRAMES_MEM - 1)
tcp_payload_flush(c);
@@ -389,7 +390,8 @@ static void tcp_data_to_tap(const struct ctx *c, struct tcp_tap_conn *conn,
tcp6_frame_conns[tcp6_payload_used] = conn;
iov = tcp6_l2_iov[tcp6_payload_used++];
- l4len = tcp_l2_buf_fill_headers(conn, iov, dlen, NULL, seq);
+ l4len = tcp_l2_buf_fill_headers(conn, iov, dlen, NULL, seq,
+ false);
iov[TCP_IOV_PAYLOAD].iov_len = l4len;
if (tcp6_payload_used > TCP_FRAMES_MEM - 1)
tcp_payload_flush(c);