summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2019-11-17 13:35:40 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-11-21 15:03:16 +0100
commit0b46c72d62ec596492e7277cea1b9f4fa6ed7078 (patch)
tree942fb09a23b1b0879fd8471a1fff006228094d73
parent4d546fa824731c285a9d601e16a415c7e7269fc0 (diff)
src: Fix IPv4 checksum calculation in AF_BRIDGE packet buffer
Updated: src/extra/pktbuff.c: If pktb was created in family AF_BRIDGE, then pktb->len will include the bytes in the network header. So set the IPv4 length to "tail - network_header" rather than len Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/extra/ipv4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
index 0227b62..c03f23f 100644
--- a/src/extra/ipv4.c
+++ b/src/extra/ipv4.c
@@ -117,7 +117,7 @@ int nfq_ip_mangle(struct pkt_buff *pktb, unsigned int dataoff,
return 0;
/* fix IP hdr checksum information */
- iph->tot_len = htons(pktb->len);
+ iph->tot_len = htons(pktb->tail - pktb->network_header);
nfq_ip_set_checksum(iph);
return 1;