Hello Luca, and all
Revision 3422 couldn't be compiled on linux kernel 2.6.24.
It is patch for linux kernel 2.6.24.
thanks,
Hitoshi Irino
Index: ring_packet.c
===================================================================
--- ring_packet.c (revision 3422)
+++ ring_packet.c (working copy)
@@ -208,7 +208,11 @@
static int remove_from_cluster(struct sock *sock, struct ring_opt *pfr);
/* Extern */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
extern struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user);
+#else /* 2.6.24 and above */
+extern int ip_defrag(struct sk_buff *skb, u32 user);
+#endif
/* ********************************** */
@@ -359,9 +363,13 @@
/* Returns new sk_buff, or NULL */
static struct sk_buff *ring_gather_frags(struct sk_buff *skb)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
+ if(ip_defrag(skb, IP_DEFRAG_RING))
+#else
skb = ip_defrag(skb, IP_DEFRAG_RING);
if(skb)
+#endif
ip_send_check(ip_hdr(skb));
return(skb);
@@ -525,7 +533,11 @@
static void ring_proc_init(void)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
ring_proc_dir = proc_mkdir("pf_ring", proc_net);
+#else /* 2.6.24 and above */
+ ring_proc_dir = proc_mkdir("pf_ring", init_net.proc_net);
+#endif
if(ring_proc_dir) {
ring_proc_dir->owner = THIS_MODULE;
@@ -558,7 +570,11 @@
printk("[PF_RING] removed /proc/net/pf_ring/info\n");
if(ring_proc_dir != NULL) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry("pf_ring", proc_net);
+#else /* 2.6.24 and above */
+ remove_proc_entry("pf_ring", init_net.proc_net);
+#endif
printk("[PF_RING] deregistered /proc/net/pf_ring\n");
}
}
@@ -1636,7 +1652,11 @@
/* ********************************** */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
static int ring_create(struct socket *sock, int protocol)
+#else /* 2.6.24 and above */
+static int ring_create(struct net *net, struct socket *sock, int protocol)
+#endif
{
struct sock *sk;
struct ring_opt *pfr;
@@ -1667,10 +1687,12 @@
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
sk = sk_alloc(PF_RING, GFP_KERNEL, 1, NULL);
-#else
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
// BD: API changed in 2.6.12, ref:
// http://svn.clkao.org/svnweb/linux/revision/?rev=28201
sk = sk_alloc(PF_RING, GFP_ATOMIC, &ring_proto, 1);
+#else /* 2.6.24 and above */
+ sk = sk_alloc(net, PF_RING, GFP_ATOMIC, &ring_proto);
#endif
#else
/* Kernel 2.4 */
@@ -1946,7 +1968,11 @@
printk("[PF_RING] searching device %s\n", sa->sa_data);
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
if((dev = __dev_get_by_name(sa->sa_data)) == NULL) {
+#else /* 2.6.24 and above */
+ if((dev = __dev_get_by_name(&init_net, sa->sa_data)) == NULL) {
+#endif
#if defined(RING_DEBUG)
printk("[PF_RING] search failed\n");
#endif
@@ -2465,7 +2491,11 @@
#endif
write_lock(&pfr->ring_rules_lock);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
pfr->reflector_dev = dev_get_by_name(devName);
+#else /* 2.6.24 and above */
+ pfr->reflector_dev = dev_get_by_name(&init_net, devName);
+#endif
write_unlock(&pfr->ring_rules_lock);
#if defined(RING_DEBUG)
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev