#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/checksum.h>
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
-#include <net/ip6_checksum.h>
-#endif
+
#include <linux/in6.h>
#include "siit.h"
*/
int tos_ignore_flag = 0;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-static inline void
-skb_reset_mac_header(struct sk_buff *skb)
-{
- skb->mac.raw=skb->data;
-}
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
static struct net_device_stats *
siit_get_stats(struct net_device *dev)
{
return netdev_priv(dev);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+static inline void
+skb_reset_mac_header(struct sk_buff *skb)
+{
+ skb->mac.raw=skb->data;
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
static inline void random_ether_addr(u8 *addr)
{
get_random_bytes (addr, ETH_ALEN);
addr [0] &= 0xfe; /* clear multicast bit */
addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
}
-
+#endif
#define siit_stats(_dev) ((struct net_device_stats *)netdev_priv(_dev))
#else
return 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
static bool header_ops_init = false;
static struct header_ops siit_header_ops ____cacheline_aligned;
#endif
dev->flags |= IFF_NOARP; /* ARP not used */
dev->tx_queue_len = 10;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
dev->hard_header_cache = NULL; /* Disable caching */
memset(netdev_priv(dev), 0, sizeof(struct net_device_stats));
dev->get_stats = siit_get_stats;
int res = -ENOMEM;
int priv_size;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
priv_size = sizeof(struct net_device_stats);
#else
priv_size = sizeof(struct header_ops);