]> err.no Git - linux-2.6/commitdiff
[NETFILTER]: bridge: fix double POSTROUTING hook invocation
authorPatrick McHardy <kaber@trash.net>
Tue, 13 Nov 2007 10:58:44 +0000 (02:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Nov 2007 10:58:44 +0000 (02:58 -0800)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netfilter.c

index da22f900e89dca6f54b9b46990e37d6f7feb8086..c1757c79dfbb3eaf7f857441f9a71966155b24a0 100644 (file)
@@ -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;