summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2020-01-24 14:40:19 +0300
committerDavid S. Miller <davem@davemloft.net>2020-01-24 14:58:14 +0300
commitac0e932d0e2988c125be251715d83e95839cdae3 (patch)
tree8b562d656072c41cf7e578a18d2db4c2443b3d6b /net/bridge
parent9bbc8be29d66cc34b650510f2c67b5c55235fe5d (diff)
downloadlinux-ac0e932d0e2988c125be251715d83e95839cdae3.tar.xz
net: bridge: check port state before br_allowed_egress
If we make sure that br_allowed_egress is called only when we have BR_STATE_FORWARDING state then we can avoid a test later when we add per-vlan state. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_forward.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 86637000f275..7629b63f6f30 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -25,7 +25,7 @@ static inline int should_deliver(const struct net_bridge_port *p,
vg = nbp_vlan_group_rcu(p);
return ((p->flags & BR_HAIRPIN_MODE) || skb->dev != p->dev) &&
- br_allowed_egress(vg, skb) && p->state == BR_STATE_FORWARDING &&
+ p->state == BR_STATE_FORWARDING && br_allowed_egress(vg, skb) &&
nbp_switchdev_allowed_egress(p, skb) &&
!br_skb_isolated(p, skb);
}