From 46c10c1254bd98fd0c8be4c557c5db3a9be6af3d Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 11 Dec 2009 21:33:41 -0800 Subject: [PATCH] Backport netdev_alloc_skb_ip_align Signed-off-by: Luis R. Rodriguez --- include/linux/compat-2.6.33.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h index 8ac44e5..0942baf 100644 --- a/include/linux/compat-2.6.33.h +++ b/include/linux/compat-2.6.33.h @@ -7,6 +7,8 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) +#include + #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ /* source: include/linux/if.h */ @@ -16,6 +18,16 @@ /* this will never happen on older kernels */ #define NETDEV_POST_INIT 0xffff +static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length) +{ + struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); + + if (NET_IP_ALIGN && skb) + skb_reserve(skb, NET_IP_ALIGN); + return skb; +} + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */ #endif /* LINUX_26_33_COMPAT_H */ -- 2.46.0