aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2014-05-20 10:59:26 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-20 11:24:26 -0400
commite1618d461ca18d40f9c3ef70598abb72e75d27ae (patch)
treeaa6ef19b4b6c2d854ccbd09663b8e404aa68f45d /include/linux
parent4f337ed5c014752b000f593182fdcfa3ecf0d166 (diff)
vlan: Fix build error wth vlan_get_encap_level()
The new function vlan_get_encap_level() uses vlan_dev_priv() which is only conditionally avaialble when VLAN support is enabled. Make vlan_get_encap_level() conditionally available as well. Fixes: 44a4085538c8 ("bonding: Fix stacked device detection in arp monitoring") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> CC: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if_vlan.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index c901b13b6f03..b2acc4a1b13c 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -198,6 +198,12 @@ extern void vlan_vids_del_by_dev(struct net_device *dev,
198 const struct net_device *by_dev); 198 const struct net_device *by_dev);
199 199
200extern bool vlan_uses_dev(const struct net_device *dev); 200extern bool vlan_uses_dev(const struct net_device *dev);
201
202static inline int vlan_get_encap_level(struct net_device *dev)
203{
204 BUG_ON(!is_vlan_dev(dev));
205 return vlan_dev_priv(dev)->nest_level;
206}
201#else 207#else
202static inline struct net_device * 208static inline struct net_device *
203__vlan_find_dev_deep(struct net_device *real_dev, 209__vlan_find_dev_deep(struct net_device *real_dev,
@@ -264,6 +270,11 @@ static inline bool vlan_uses_dev(const struct net_device *dev)
264{ 270{
265 return false; 271 return false;
266} 272}
273static inline int vlan_get_encap_level(struct net_device *dev)
274{
275 BUG();
276 return 0;
277}
267#endif 278#endif
268 279
269static inline bool vlan_hw_offload_capable(netdev_features_t features, 280static inline bool vlan_hw_offload_capable(netdev_features_t features,
@@ -485,9 +496,4 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
485 skb->protocol = htons(ETH_P_802_2); 496 skb->protocol = htons(ETH_P_802_2);
486} 497}
487 498
488static inline int vlan_get_encap_level(struct net_device *dev)
489{
490 BUG_ON(!is_vlan_dev(dev));
491 return vlan_dev_priv(dev)->nest_level;
492}
493#endif /* !(_LINUX_IF_VLAN_H_) */ 499#endif /* !(_LINUX_IF_VLAN_H_) */