diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2020-01-24 13:40:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-24 12:58:14 +0100 |
commit | ac0e932d0e2988c125be251715d83e95839cdae3 (patch) | |
tree | 8b562d656072c41cf7e578a18d2db4c2443b3d6b | |
parent | 9bbc8be29d66cc34b650510f2c67b5c55235fe5d (diff) |
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>
-rw-r--r-- | net/bridge/br_forward.c | 2 |
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); } |