1
0
Fork 0
mirror of https://passt.top/passt synced 2025-08-05 07:18:00 +02:00

tcp: Pass TCP header and payload separately to tcp_update_check_tcp[46]()

Currently these expects both the TCP header and payload in a single IOV,
and goes to some trouble to locate the checksum field within it.  In the
current caller we've already know where the TCP header is, so we might as
well just pass it in.  This will need to work a bit differently for
vhost-user, but that code already needs to locate the TCP header for other
reasons, so again we can just pass it in.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2024-11-27 14:54:06 +11:00 committed by Stefano Brivio
commit 2ee07697c4
3 changed files with 34 additions and 94 deletions

View file

@ -162,12 +162,10 @@ void tcp_rst_do(const struct ctx *c, struct tcp_tap_conn *conn);
struct tcp_info_linux;
void tcp_update_check_tcp4(const struct iphdr *iph,
const struct iovec *iov, int iov_cnt,
size_t l4offset);
void tcp_update_check_tcp6(const struct ipv6hdr *ip6h,
const struct iovec *iov, int iov_cnt,
size_t l4offset);
void tcp_update_check_tcp4(const struct iphdr *iph, struct tcphdr *th,
struct iov_tail *payload);
void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, struct tcphdr *th,
struct iov_tail *payload);
void tcp_fill_headers4(const struct tcp_tap_conn *conn,
struct tap_hdr *taph, struct iphdr *iph,
struct tcp_payload_t *bp, size_t dlen,