nfqws: checksum int => size_t

This commit is contained in:
bol-van 2020-02-03 12:57:59 +03:00
parent c2c8c83c03
commit 7c418a11f8
2 changed files with 6 additions and 6 deletions

View File

@ -119,17 +119,17 @@ uint16_t csum_ipv6_magic(const void *saddr, const void *daddr, size_t len, uint8
}
void tcp4_fix_checksum(struct tcphdr *tcp,int len, in_addr_t src_addr, in_addr_t dest_addr)
void tcp4_fix_checksum(struct tcphdr *tcp,size_t len, in_addr_t src_addr, in_addr_t dest_addr)
{
tcp->check = 0;
tcp->check = csum_tcpudp_magic(src_addr,dest_addr,len,IPPROTO_TCP,csum_partial(tcp, len));
}
void tcp6_fix_checksum(struct tcphdr *tcp,int len, const struct in6_addr *src_addr, const struct in6_addr *dest_addr)
void tcp6_fix_checksum(struct tcphdr *tcp,size_t len, const struct in6_addr *src_addr, const struct in6_addr *dest_addr)
{
tcp->check = 0;
tcp->check = csum_ipv6_magic(src_addr,dest_addr,len,IPPROTO_TCP,csum_partial(tcp, len));
}
void tcp_fix_checksum(struct tcphdr *tcp,int len,const struct iphdr *iphdr,const struct ip6_hdr *ip6hdr)
void tcp_fix_checksum(struct tcphdr *tcp,size_t len,const struct iphdr *iphdr,const struct ip6_hdr *ip6hdr)
{
if (iphdr)
tcp4_fix_checksum(tcp, len, iphdr->saddr, iphdr->daddr);

View File

@ -12,6 +12,6 @@ uint16_t csum_ipv6_magic(const void *saddr, const void *daddr, size_t len, uint8
uint16_t ip4_compute_csum(const void *buff, size_t len);
void ip4_fix_checksum(struct iphdr *ip);
void tcp4_fix_checksum(struct tcphdr *tcp,int len, in_addr_t src_addr, in_addr_t dest_addr);
void tcp6_fix_checksum(struct tcphdr *tcp,int len, const struct in6_addr *src_addr, const struct in6_addr *dest_addr);
void tcp_fix_checksum(struct tcphdr *tcp,int len,const struct iphdr *iphdr,const struct ip6_hdr *ip6hdr);
void tcp4_fix_checksum(struct tcphdr *tcp,size_t len, in_addr_t src_addr, in_addr_t dest_addr);
void tcp6_fix_checksum(struct tcphdr *tcp,size_t len, const struct in6_addr *src_addr, const struct in6_addr *dest_addr);
void tcp_fix_checksum(struct tcphdr *tcp,size_t len,const struct iphdr *iphdr,const struct ip6_hdr *ip6hdr);