Skip to content

Commit

Permalink
vlan: Fix build error wth vlan_get_encap_level()
Browse files Browse the repository at this point in the history
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: 44a4085 ("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>
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed May 20, 2014
1 parent 4f337ed commit e1618d4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions include/linux/if_vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ extern void vlan_vids_del_by_dev(struct net_device *dev,
const struct net_device *by_dev);

extern bool vlan_uses_dev(const struct net_device *dev);

static inline int vlan_get_encap_level(struct net_device *dev)
{
BUG_ON(!is_vlan_dev(dev));
return vlan_dev_priv(dev)->nest_level;
}
#else
static inline struct net_device *
__vlan_find_dev_deep(struct net_device *real_dev,
Expand Down Expand Up @@ -264,6 +270,11 @@ static inline bool vlan_uses_dev(const struct net_device *dev)
{
return false;
}
static inline int vlan_get_encap_level(struct net_device *dev)
{
BUG();
return 0;
}
#endif

static inline bool vlan_hw_offload_capable(netdev_features_t features,
Expand Down Expand Up @@ -485,9 +496,4 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
skb->protocol = htons(ETH_P_802_2);
}

static inline int vlan_get_encap_level(struct net_device *dev)
{
BUG_ON(!is_vlan_dev(dev));
return vlan_dev_priv(dev)->nest_level;
}
#endif /* !(_LINUX_IF_VLAN_H_) */

0 comments on commit e1618d4

Please sign in to comment.