aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/if_bridge.h6
-rw-r--r--net/bridge/br_vlan.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 950db1dad830..9e57c4411734 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -89,6 +89,7 @@ static inline bool br_multicast_router(const struct net_device *dev)
89bool br_vlan_enabled(const struct net_device *dev); 89bool br_vlan_enabled(const struct net_device *dev);
90int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid); 90int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid);
91int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid); 91int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid);
92int br_vlan_get_proto(const struct net_device *dev, u16 *p_proto);
92int br_vlan_get_info(const struct net_device *dev, u16 vid, 93int br_vlan_get_info(const struct net_device *dev, u16 vid,
93 struct bridge_vlan_info *p_vinfo); 94 struct bridge_vlan_info *p_vinfo);
94#else 95#else
@@ -102,6 +103,11 @@ static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid)
102 return -EINVAL; 103 return -EINVAL;
103} 104}
104 105
106static inline int br_vlan_get_proto(const struct net_device *dev, u16 *p_proto)
107{
108 return -EINVAL;
109}
110
105static inline int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid) 111static inline int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid)
106{ 112{
107 return -EINVAL; 113 return -EINVAL;
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 8d97b91ad503..021cc9f66804 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -797,6 +797,16 @@ bool br_vlan_enabled(const struct net_device *dev)
797} 797}
798EXPORT_SYMBOL_GPL(br_vlan_enabled); 798EXPORT_SYMBOL_GPL(br_vlan_enabled);
799 799
800int br_vlan_get_proto(const struct net_device *dev, u16 *p_proto)
801{
802 struct net_bridge *br = netdev_priv(dev);
803
804 *p_proto = ntohs(br->vlan_proto);
805
806 return 0;
807}
808EXPORT_SYMBOL_GPL(br_vlan_get_proto);
809
800int __br_vlan_set_proto(struct net_bridge *br, __be16 proto) 810int __br_vlan_set_proto(struct net_bridge *br, __be16 proto)
801{ 811{
802 int err = 0; 812 int err = 0;