tcp: Fix build against musl, __sum16 comes from linux/types.h
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 <omni+alpine@hack.org>
Fixes: 3d484aa370
("tcp: Update TCP checksum using an iovec array")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
ee7d0b62a7
commit
d165d36a0c
1 changed files with 4 additions and 4 deletions
8
tcp.c
8
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 saddr = { .s_addr = iph->saddr };
|
||||||
struct in_addr daddr = { .s_addr = iph->daddr };
|
struct in_addr daddr = { .s_addr = iph->daddr };
|
||||||
size_t check_ofs;
|
size_t check_ofs;
|
||||||
__sum16 *check;
|
uint16_t *check;
|
||||||
int check_idx;
|
int check_idx;
|
||||||
uint32_t sum;
|
uint32_t sum;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
@ -797,7 +797,7 @@ static void tcp_update_check_tcp4(const struct iphdr *iph,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = (__sum16 *)ptr;
|
check = (uint16_t *)ptr;
|
||||||
|
|
||||||
*check = 0;
|
*check = 0;
|
||||||
*check = csum_iov(iov, iov_cnt, l4offset, sum);
|
*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);
|
uint16_t l4len = ntohs(ip6h->payload_len);
|
||||||
size_t check_ofs;
|
size_t check_ofs;
|
||||||
__sum16 *check;
|
uint16_t *check;
|
||||||
int check_idx;
|
int check_idx;
|
||||||
uint32_t sum;
|
uint32_t sum;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
@ -848,7 +848,7 @@ static void tcp_update_check_tcp6(const struct ipv6hdr *ip6h,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = (__sum16 *)ptr;
|
check = (uint16_t *)ptr;
|
||||||
|
|
||||||
*check = 0;
|
*check = 0;
|
||||||
*check = csum_iov(iov, iov_cnt, l4offset, sum);
|
*check = csum_iov(iov, iov_cnt, l4offset, sum);
|
||||||
|
|
Loading…
Reference in a new issue