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/internal.h | |
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/internal.h')
-rw-r--r-- | src/internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/internal.h b/src/internal.h index 0cfa425..ae849d6 100644 --- a/src/internal.h +++ b/src/internal.h @@ -24,7 +24,6 @@ struct pkt_buff { uint8_t *transport_header; uint8_t *data; - uint8_t *tail; uint32_t len; uint32_t data_len; @@ -32,4 +31,8 @@ struct pkt_buff { bool mangled; }; +static inline uint8_t *pktb_tail(struct pkt_buff *pktb) +{ + return pktb->data + pktb->len; +} #endif |