#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
-@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size)
+@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint
sum += *buf++;
size -= sizeof(uint16_t);
}
sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >>16);
-@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size)
+@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint
return (uint16_t)(~sum);
}
{
uint32_t sum = 0;
uint32_t iph_len = iph->ihl*4;
-@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph)
+@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct
sum += (iph->saddr) & 0xFFFF;
sum += (iph->daddr >> 16) & 0xFFFF;
sum += (iph->daddr) & 0xFFFF;
{
uint32_t sum = 0;
uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h;
-@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr)
+@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct
sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF;
sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF;
}
sum += htons(ip6h->ip6_plen);
return nfq_checksum(sum, (uint16_t *)payload, len);
-diff --git a/src/extra/tcp.c b/src/extra/tcp.c
-index d1cd79d..a66f392 100644
--- a/src/extra/tcp.c
+++ b/src/extra/tcp.c
-@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph)
+@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp
{
/* checksum field in header needs to be zero for calculation. */
tcph->check = 0;
}
EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4);
-@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h)
+@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp
{
/* checksum field in header needs to be zero for calculation. */
tcph->check = 0;
--- a/src/extra/udp.c
+++ b/src/extra/udp.c
-@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph)
+@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp
{
/* checksum field in header needs to be zero for calculation. */
udph->check = 0;
}
EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
-@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
+@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp
{
/* checksum field in header needs to be zero for calculation. */
udph->check = 0;