Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Duncan Roe <duncan_roe@optusnet.com.au>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH libnetfilter_queue 2/2] src: Make sure pktb_alloc() works for AF_INET6 since we document that it does
Date: Mon, 11 Nov 2019 15:17:23 +1100
Message-ID: <20191111041723.30660-3-duncan_roe@optusnet.com.au> (raw)
In-Reply-To: <20191111041723.30660-1-duncan_roe@optusnet.com.au>

Without this patch, AF_INET6 pktb_alloc() creates a pktb with NULL
network_header. But in src/extra/ipv6.c, nfq_ip6_get_hdr() assumes that
pktb->network_header is valid.

Updated:

 src/extra/pktbuff.c: Treat AF_INET6 the same as AF_INET.

Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
---
 src/extra/pktbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index 3a08d49..c52b674 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -63,6 +63,7 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
 
 	switch(family) {
 	case AF_INET:
+	case AF_INET6:
 		pktb->network_header = pktb->data;
 		break;
 	case AF_BRIDGE: {
-- 
2.14.5


  parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11  4:17 [PATCH libnetfilter_queue 0/2] Miscellaneous fixes Duncan Roe
2019-11-11  4:17 ` [PATCH libnetfilter_queue 1/2] src: pktb_trim() was not updating tail after updating len Duncan Roe
2019-11-11  4:17 ` Duncan Roe [this message]
2019-11-12 21:33 ` [PATCH libnetfilter_queue 0/2] Miscellaneous fixes Pablo Neira Ayuso

Reply instructions:

You may reply publically 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=20191111041723.30660-3-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

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git