From 539ed0ab0af21d61c422ba2a85d7554f74158d51 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 11 Sep 2010 09:19:58 -0700 Subject: [PATCH] compat: backport skb_checksum_none_assert This is needed by atlx, b44, atl1c and atl1e. Signed-off-by: Hauke Mehrtens --- include/linux/compat-2.6.37.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index 5bd6edb03f38..8ea0bab542b8 100644 --- a/include/linux/compat-2.6.37.h +++ b/include/linux/compat-2.6.37.h @@ -5,6 +5,8 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) +#include + /* * This is not part of The 2.6.37 kernel yet but we * we use it to optimize the backport code we @@ -26,6 +28,21 @@ extern struct kobj_ns_type_operations net_ns_type_operations; +/** + * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE + * @skb: skb to check + * + * fresh skbs have their ip_summed set to CHECKSUM_NONE. + * Instead of forcing ip_summed to CHECKSUM_NONE, we can + * use this helper, to document places where we make this assertion. + */ +static inline void skb_checksum_none_assert(struct sk_buff *skb) +{ +#ifdef DEBUG + BUG_ON(skb->ip_summed != CHECKSUM_NONE); +#endif +} + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */ #endif /* LINUX_26_37_COMPAT_H */ -- 2.30.2