summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0c30af38be0d..d9c961aa6a7f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1921,6 +1921,15 @@ static inline int dev_parse_header(const struct sk_buff *skb,
1921 return dev->header_ops->parse(skb, haddr); 1921 return dev->header_ops->parse(skb, haddr);
1922} 1922}
1923 1923
1924static inline int dev_rebuild_header(struct sk_buff *skb)
1925{
1926 const struct net_device *dev = skb->dev;
1927
1928 if (!dev->header_ops || !dev->header_ops->rebuild)
1929 return 0;
1930 return dev->header_ops->rebuild(skb);
1931}
1932
1924typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); 1933typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
1925int register_gifconf(unsigned int family, gifconf_func_t *gifconf); 1934int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
1926static inline int unregister_gifconf(unsigned int family) 1935static inline int unregister_gifconf(unsigned int family)
@@ -3039,6 +3048,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
3039 dev->gso_max_size = size; 3048 dev->gso_max_size = size;
3040} 3049}
3041 3050
3051static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
3052 int pulled_hlen, u16 mac_offset,
3053 int mac_len)
3054{
3055 skb->protocol = protocol;
3056 skb->encapsulation = 1;
3057 skb_push(skb, pulled_hlen);
3058 skb_reset_transport_header(skb);
3059 skb->mac_header = mac_offset;
3060 skb->network_header = skb->mac_header + mac_len;
3061 skb->mac_len = mac_len;
3062}
3063
3042static inline bool netif_is_macvlan(struct net_device *dev) 3064static inline bool netif_is_macvlan(struct net_device *dev)
3043{ 3065{
3044 return dev->priv_flags & IFF_MACVLAN; 3066 return dev->priv_flags & IFF_MACVLAN;