netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan Roe <duncan_roe@optusnet.com.au>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH libnetfilter_queue] src: Simplify struct pkt_buff: remove head
Date: Fri, 17 Jan 2020 22:32:03 +1100	[thread overview]
Message-ID: <20200117113203.17313-1-duncan_roe@optusnet.com.au> (raw)
In-Reply-To: <20200110111218.rd5c7basrv24jxqg@salvia>

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>
---
 src/extra/pktbuff.c | 5 ++---
 src/internal.h      | 1 -
 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;
 
-- 
2.14.5


  reply	other threads:[~2020-01-17 11:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  4:09 [PATCH RFC libnetfilter_queue] src: Simplify struct pkt_buff Duncan Roe
2020-01-10 11:12 ` Pablo Neira Ayuso
2020-01-17 11:32   ` Duncan Roe [this message]
2020-01-17 14:09     ` [PATCH libnetfilter_queue] src: Simplify struct pkt_buff: remove tail Duncan Roe
2020-01-18 20:43       ` Pablo Neira Ayuso
2020-01-26  4:02         ` [PATCH libnetfilter_queue v2 0/1] " Duncan Roe
2020-01-26  4:02         ` [PATCH libnetfilter_queue v2 1/1] " Duncan Roe
2020-01-29 17:39           ` Pablo Neira Ayuso
2020-01-18 20:40     ` [PATCH libnetfilter_queue] src: Simplify struct pkt_buff: remove head Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200117113203.17313-1-duncan_roe@optusnet.com.au \
    --to=duncan_roe@optusnet.com.au \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).