Re: [PATCH v2 net 2/3] bridge: Simplify pvid checks.
From: Toshiaki Makita <hidden>
Date: 2014-10-01 06:50:01
Also in:
bridge
From: Toshiaki Makita <hidden>
Date: 2014-10-01 06:50:01
Also in:
bridge
On 2014/10/01 4:31, Vladislav Yasevich wrote:
Currently, if the pvid is not set, we return an illegal vlan value even though the pvid value is set to 0. Since pvid of 0 is currently invalid, just return 0 instead. This makes the current and future checks simpler. Signed-off-by: Vladislav Yasevich <redacted> --- net/bridge/br_private.h | 2 +- net/bridge/br_vlan.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 6fe8680..873d9da 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h@@ -647,7 +647,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v) * vid wasn't set */
The comment above should be changed as well.
smp_rmb(); - return v->pvid ?: VLAN_N_VID; + return v->pvid; }
Should fix br_get_pvid() when CONFIG_BRIDGE_VLAN_FILTERING=n? It returns VLAN_N_VID, which might be confusing. Thanks, Toshiaki Makita