From: Patrick McHardy Date: Tue, 13 Nov 2007 10:58:44 +0000 (-0800) Subject: [NETFILTER]: bridge: fix double POSTROUTING hook invocation X-Git-Tag: v2.6.24-rc3~145^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d9ddae856678c45297550e9353c8a5a7fd6438;p=linux-2.6 [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 Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index da22f900e8..c1757c79df 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;