diff options
-rw-r--r-- | include/linux/if_bridge.h | 6 | ||||
-rw-r--r-- | net/bridge/br_vlan.c | 10 |
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) | |||
89 | bool br_vlan_enabled(const struct net_device *dev); | 89 | bool br_vlan_enabled(const struct net_device *dev); |
90 | int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid); | 90 | int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid); |
91 | int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid); | 91 | int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid); |
92 | int br_vlan_get_proto(const struct net_device *dev, u16 *p_proto); | ||
92 | int br_vlan_get_info(const struct net_device *dev, u16 vid, | 93 | int 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 | ||
106 | static inline int br_vlan_get_proto(const struct net_device *dev, u16 *p_proto) | ||
107 | { | ||
108 | return -EINVAL; | ||
109 | } | ||
110 | |||
105 | static inline int br_vlan_get_pvid_rcu(const struct net_device *dev, u16 *p_pvid) | 111 | static 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 | } |
798 | EXPORT_SYMBOL_GPL(br_vlan_enabled); | 798 | EXPORT_SYMBOL_GPL(br_vlan_enabled); |
799 | 799 | ||
800 | int 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 | } | ||
808 | EXPORT_SYMBOL_GPL(br_vlan_get_proto); | ||
809 | |||
800 | int __br_vlan_set_proto(struct net_bridge *br, __be16 proto) | 810 | int __br_vlan_set_proto(struct net_bridge *br, __be16 proto) |
801 | { | 811 | { |
802 | int err = 0; | 812 | int err = 0; |