Browse Source

nfqws: checksum int => size_t

pull/53/head
bol-van 6 years ago
parent
commit
7c418a11f8
  1. 6
      nfq/checksum.c
  2. 6
      nfq/checksum.h

6
nfq/checksum.c

@ -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);

6
nfq/checksum.h

@ -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);

Loading…
Cancel
Save