From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id A526A5A061A; Thu, 31 Oct 2024 08:14:32 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v2] tcp: Fix build against musl, __sum16 comes from linux/types.h Date: Thu, 31 Oct 2024 08:14:32 +0100 Message-ID: <20241031071432.536227-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: TS2UOHTL7YOCNRTUAWBYEBKPT25CAQN7 X-Message-ID-Hash: TS2UOHTL7YOCNRTUAWBYEBKPT25CAQN7 X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier , David Gibson , omni X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use a plain uint16_t instead and avoid including one extra header: the 'bitwise' attribute of __sum16 is just used by sparse(1). Reported-by: omni Fixes: 3d484aa37090 ("tcp: Update TCP checksum using an iovec array") Signed-off-by: Stefano Brivio --- v2: Use uint16_t instead of including linux/types.h tcp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcp.c b/tcp.c index 4e0a17e..56ceba6 100644 --- a/tcp.c +++ b/tcp.c @@ -766,7 +766,7 @@ static void tcp_update_check_tcp4(const struct iphdr *iph, struct in_addr saddr = { .s_addr = iph->saddr }; struct in_addr daddr = { .s_addr = iph->daddr }; size_t check_ofs; - __sum16 *check; + uint16_t *check; int check_idx; uint32_t sum; char *ptr; @@ -797,7 +797,7 @@ static void tcp_update_check_tcp4(const struct iphdr *iph, return; } - check = (__sum16 *)ptr; + check = (uint16_t *)ptr; *check = 0; *check = csum_iov(iov, iov_cnt, l4offset, sum); @@ -816,7 +816,7 @@ static void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, { uint16_t l4len = ntohs(ip6h->payload_len); size_t check_ofs; - __sum16 *check; + uint16_t *check; int check_idx; uint32_t sum; char *ptr; @@ -848,7 +848,7 @@ static void tcp_update_check_tcp6(const struct ipv6hdr *ip6h, return; } - check = (__sum16 *)ptr; + check = (uint16_t *)ptr; *check = 0; *check = csum_iov(iov, iov_cnt, l4offset, sum); -- 2.43.0