diff options
author | Duncan Roe <duncan_roe@optusnet.com.au> | 2020-01-26 15:02:02 +1100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-01-29 18:36:32 +0100 |
commit | 9d360e93cb2688f3fb8c37fd8e76e2a02e2d12bd (patch) | |
tree | dc26fca2742bad9dfca16fea4af068ed5ac6175e /src/extra/ipv4.c | |
parent | ba3a63eefbfeeafc95cb401777ba049af32a2b4d (diff) |
Simplify struct pkt_buff: remove tail
In struct pkt_buff, we only ever needed any 2 of len, data and tail.
This has caused bugs in the past, e.g. commit 8a4316f31.
Delete tail, and where the value of pktb->tail was required,
use new pktb_tail() function.
Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra/ipv4.c')
-rw-r--r-- | src/extra/ipv4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c index caafd37..797bab1 100644 --- a/src/extra/ipv4.c +++ b/src/extra/ipv4.c @@ -40,7 +40,7 @@ EXPORT_SYMBOL struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb) { struct iphdr *iph; - unsigned int pktlen = pktb->tail - pktb->network_header; + unsigned int pktlen = pktb_tail(pktb) - pktb->network_header; /* Not enough room for IPv4 header. */ if (pktlen < sizeof(struct iphdr)) @@ -135,7 +135,7 @@ int nfq_ip_mangle(struct pkt_buff *pktb, unsigned int dataoff, return 0; /* fix IP hdr checksum information */ - iph->tot_len = htons(pktb->tail - pktb->network_header); + iph->tot_len = htons(pktb_tail(pktb) - pktb->network_header); nfq_ip_set_checksum(iph); return 1; |