]> git.openpandora.org Git - pandora-kernel.git/commitdiff
bridge: Simplify pvid checks.
authorVlad Yasevich <vyasevich@gmail.com>
Fri, 3 Oct 2014 15:29:17 +0000 (11:29 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Oct 2014 01:21:36 +0000 (21:21 -0400)
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 <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_private.h
net/bridge/br_vlan.c

index 5a347eb1d139348c007dc9c5b15e480ca4c254cc..f671561b3053328686e215dba6197d45b5517390 100644 (file)
@@ -643,11 +643,8 @@ static inline int br_vlan_get_tag(const struct sk_buff *skb, u16 *vid)
 
 static inline u16 br_get_pvid(const struct net_port_vlans *v)
 {
-       /* Return just the VID if it is set, or VLAN_N_VID (invalid vid) if
-        * vid wasn't set
-        */
        smp_rmb();
-       return v->pvid ?: VLAN_N_VID;
+       return v->pvid;
 }
 
 static inline int br_vlan_enabled(struct net_bridge *br)
@@ -746,7 +743,7 @@ static inline u16 br_vlan_get_tag(const struct sk_buff *skb, u16 *tag)
 }
 static inline u16 br_get_pvid(const struct net_port_vlans *v)
 {
-       return VLAN_N_VID;      /* Returns invalid vid */
+       return 0;
 }
 
 static inline int br_vlan_enabled(struct net_bridge *br)
Simple merge