Commit d1c6c708 authored by Toshiaki Makita's avatar Toshiaki Makita Committed by David S. Miller

bridge: Fix the way the PVID is referenced

We are using the VLAN_TAG_PRESENT bit to detect whether the PVID is
set or not at br_get_pvid(), while we don't care about the bit in
adding/deleting the PVID, which makes it impossible to forward any
incomming untagged frame with vlan_filtering enabled.

Since vid 0 cannot be used for the PVID, we can use vid 0 to indicate
that the PVID is not set, which is slightly more efficient than using
the VLAN_TAG_PRESENT.

Fix the problem by getting rid of using the VLAN_TAG_PRESENT.
Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Reviewed-by: default avatarVlad Yasevich <vyasevic@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b90356ce
...@@ -643,9 +643,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v) ...@@ -643,9 +643,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
* vid wasn't set * vid wasn't set
*/ */
smp_rmb(); smp_rmb();
return (v->pvid & VLAN_TAG_PRESENT) ? return v->pvid ?: VLAN_N_VID;
(v->pvid & ~VLAN_TAG_PRESENT) :
VLAN_N_VID;
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment