netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: Patrick McHardy <kaber@trash.net>, netfilter-devel@vger.kernel.org
Subject: [NETFILTER 03/03]: bridge: fix double POSTROUTING hook invocation
Date: Tue, 13 Nov 2007 11:55:44 +0100 (MET)	[thread overview]
Message-ID: <20071113105504.25336.42744.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20071113105500.25336.39074.sendpatchset@localhost.localdomain>

[NETFILTER]: bridge: fix double POSTROUTING hook invocation

Packets routed between bridges have the POST_ROUTING hook invoked
twice since bridging mistakes them for bridged packets because
they have skb->nf_bridge set.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 87a1cd0a4fc1f5ac17e2e752668ae324c595b1fd
tree 38c7fdb13f7232bf77fb78ce4292a4bb1cdd5dfd
parent c94ac2cb9896fbed3065dc08216a7d13b98f0d92
author Patrick McHardy <kaber@trash.net> Tue, 13 Nov 2007 11:24:18 +0100
committer Patrick McHardy <kaber@trash.net> Tue, 13 Nov 2007 11:24:18 +0100

 net/bridge/br_netfilter.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index da22f90..c1757c7 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -766,6 +766,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
 	if (!nf_bridge)
 		return NF_ACCEPT;
 
+	if (!(nf_bridge->mask & (BRNF_BRIDGED | BRNF_BRIDGED_DNAT)))
+		return NF_ACCEPT;
+
 	if (!realoutdev)
 		return NF_DROP;
 

  parent reply	other threads:[~2007-11-13 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 10:55 [NETFILTER 00/03]: Netfilter fixes Patrick McHardy
2007-11-13 10:55 ` [NETFILTER 01/03]: nf_nat: fix memset error Patrick McHardy
2007-11-13 10:57   ` David Miller
2007-11-13 10:55 ` [NETFILTER 02/03]: Consolidate nf_sockopt and compat_nf_sockopt Patrick McHardy
2007-11-13 10:58   ` David Miller
2007-11-13 10:55 ` Patrick McHardy [this message]
2007-11-13 10:59   ` [NETFILTER 03/03]: bridge: fix double POSTROUTING hook invocation David Miller

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=20071113105504.25336.42744.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@vger.kernel.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).