aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-03-10 05:36:48 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2015-03-16 09:35:02 -0400
commite4bb9bcbfb7d67431dfd49860f62770a7f40193b (patch)
tree245ca142e52b517ffd80061be80d16f01cee9335 /net/bridge
parentc055d5b03bb4cb69d349d787c9787c0383abd8b2 (diff)
netfilter: bridge: remove BRNF_STATE_BRIDGED flag
Its not needed anymore since 2bf540b73ed5b ([NETFILTER]: bridge-netfilter: remove deferred hooks). Before this it was possible to have physoutdev set for locally generated packets -- this isn't the case anymore: BRNF_STATE_BRIDGED flag is set when we assign nf_bridge->physoutdev, so physoutdev != NULL means BRNF_STATE_BRIDGED is set. If physoutdev is NULL, then we are looking at locally-delivered and routed packet. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 261fcd5a42d6..bd2d24d1ff21 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -736,8 +736,6 @@ static unsigned int br_nf_forward_ip(const struct nf_hook_ops *ops,
736 if (pf == NFPROTO_IPV4 && br_parse_ip_options(skb)) 736 if (pf == NFPROTO_IPV4 && br_parse_ip_options(skb))
737 return NF_DROP; 737 return NF_DROP;
738 738
739 /* The physdev module checks on this */
740 nf_bridge->mask |= BRNF_BRIDGED;
741 nf_bridge->physoutdev = skb->dev; 739 nf_bridge->physoutdev = skb->dev;
742 if (pf == NFPROTO_IPV4) 740 if (pf == NFPROTO_IPV4)
743 skb->protocol = htons(ETH_P_IP); 741 skb->protocol = htons(ETH_P_IP);
@@ -857,7 +855,12 @@ static unsigned int br_nf_post_routing(const struct nf_hook_ops *ops,
857 struct net_device *realoutdev = bridge_parent(skb->dev); 855 struct net_device *realoutdev = bridge_parent(skb->dev);
858 u_int8_t pf; 856 u_int8_t pf;
859 857
860 if (!nf_bridge || !(nf_bridge->mask & BRNF_BRIDGED)) 858 /* if nf_bridge is set, but ->physoutdev is NULL, this packet came in
859 * on a bridge, but was delivered locally and is now being routed:
860 *
861 * POST_ROUTING was already invoked from the ip stack.
862 */
863 if (!nf_bridge || !nf_bridge->physoutdev)
861 return NF_ACCEPT; 864 return NF_ACCEPT;
862 865
863 if (!realoutdev) 866 if (!realoutdev)