From: Guo-Fu Tseng Date: Sun, 12 Sep 2010 23:00:27 +0000 (+0800) Subject: [CentOS] Fix CentOS 5 compile error X-Git-Tag: bp-1.0.7~11 X-Git-Url: https://bbs.cooldavid.org/git/?p=jme.git;a=commitdiff_plain;h=e516972854b5330713e192f72139986bcf70d1a5 [CentOS] Fix CentOS 5 compile error {ip|ipv6|tcp}_hdr helpers have back-ported to CentOS 5 kernel. Reported-by: "Aries Lee" Fixed-by: "Aries Lee" Modified-by: "Guo-Fu Tseng" --- diff --git a/jme.h b/jme.h index 0806276..59bbbe5 100644 --- a/jme.h +++ b/jme.h @@ -411,6 +411,23 @@ struct jme_ring { #define NETDEV_GET_STATS(netdev, fun_ptr) \ netdev->get_stats = fun_ptr #define DECLARE_NET_DEVICE_STATS struct net_device_stats stats; +/* + * CentOS 5.5 have *_hdr helpers back-ported + */ +#ifdef RHEL_RELEASE_CODE +#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,5) +#define __DEFINE_IPHDR_HELPERS__ +#endif +#else +#define __DEFINE_IPHDR_HELPERS__ +#endif +#else +#define NET_STAT(priv) (priv->dev->stats) +#define NETDEV_GET_STATS(netdev, fun_ptr) +#define DECLARE_NET_DEVICE_STATS +#endif + +#ifdef __DEFINE_IPHDR_HELPERS__ static inline struct iphdr *ip_hdr(const struct sk_buff *skb) { return skb->nh.iph; @@ -425,10 +442,6 @@ static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) { return skb->h.th; } -#else -#define NET_STAT(priv) (priv->dev->stats) -#define NETDEV_GET_STATS(netdev, fun_ptr) -#define DECLARE_NET_DEVICE_STATS #endif #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23) @@ -1306,3 +1319,4 @@ static int jme_set_settings(struct net_device *netdev, static void jme_set_multi(struct net_device *netdev); #endif +