summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2020-01-17 22:32:03 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-01-18 21:39:52 +0100
commitba3a63eefbfeeafc95cb401777ba049af32a2b4d (patch)
tree2237349f9548559c95550343bf9e18814c10081f
parent04ad0b1c48c67d31b82b1f95eee9c1d541f2df59 (diff)
src: Simplify struct pkt_buff: remove headHEADmaster
head and data always had the same value. head was in the minority, so replace with data where it was used. Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/extra/pktbuff.c5
-rw-r--r--src/internal.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index f013cfe..c95384f 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -66,9 +66,8 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
pktb->len = len;
pktb->data_len = len + extra;
- pktb->head = pkt_data;
pktb->data = pkt_data;
- pktb->tail = pktb->head + len;
+ pktb->tail = pktb->data + len;
switch(family) {
case AF_INET:
@@ -204,7 +203,7 @@ EXPORT_SYMBOL
void pktb_trim(struct pkt_buff *pktb, unsigned int len)
{
pktb->len = len;
- pktb->tail = pktb->head + len;
+ pktb->tail = pktb->data + len;
}
/**
diff --git a/src/internal.h b/src/internal.h
index d968325..0cfa425 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -23,7 +23,6 @@ struct pkt_buff {
uint8_t *network_header;
uint8_t *transport_header;
- uint8_t *head;
uint8_t *data;
uint8_t *tail;