From 9d360e93cb2688f3fb8c37fd8e76e2a02e2d12bd Mon Sep 17 00:00:00 2001 From: Duncan Roe Date: Sun, 26 Jan 2020 15:02:02 +1100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/internal.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/internal.h') 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 -- cgit v1.2.3