netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Oliverio <marco.oliverio@tanaza.com>
To: rocco.folino@tanaza.com
Cc: netdev@vger.kernel.org, fw@strlen.de,
	Marco Oliverio <marco.oliverio@tanaza.com>
Subject: [PATCH nf] netfilter: nf_queue: enqueue skbs with NULL dst
Date: Mon,  2 Dec 2019 19:42:59 +0100	[thread overview]
Message-ID: <20191202184259.30416-1-marco.oliverio@tanaza.com> (raw)

Bridge packets that are forwarded have skb->dst == NULL and get
dropped by the check introduced by
b60a77386b1d4868f72f6353d35dabe5fbe981f2 (net: make skb_dst_force
return true when dst is refcounted).

To fix this we check skb_dst() before skb_dst_force(), so we don't
drop skb packet with dst == NULL. This holds also for skb at the
PRE_ROUTING hook so we remove the second check.

Fixes: b60a773 ("net: make skb_dst_forcereturn true when dst is refcounted")

Signed-off-by: Marco Oliverio <marco.oliverio@tanaza.com>
Signed-off-by: Rocco Folino <rocco.folino@tanaza.com>
---
 net/netfilter/nf_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index a2b58de82600..f8f52ff99cfb 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -189,7 +189,7 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state,
 		goto err;
 	}
 
-	if (!skb_dst_force(skb) && state->hook != NF_INET_PRE_ROUTING) {
+	if (skb_dst(skb) && !skb_dst_force(skb)) {
 		status = -ENETDOWN;
 		goto err;
 	}
-- 
2.24.0


             reply	other threads:[~2019-12-02 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 18:42 Marco Oliverio [this message]
2019-12-02 21:51 ` [PATCH nf] netfilter: nf_queue: enqueue skbs with NULL dst Matteo Croce
2019-12-02 18:43 Marco Oliverio
2019-12-02 18:45 Marco Oliverio
2019-12-02 18:54 Marco Oliverio
2019-12-02 18:58 ` Florian Westphal
2019-12-02 19:04 ` Marco Oliverio
2019-12-07 18:52 ` 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=20191202184259.30416-1-marco.oliverio@tanaza.com \
    --to=marco.oliverio@tanaza.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=rocco.folino@tanaza.com \
    /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).