[netfilter-cvslog] r3806 - trunk/nfsim/core/ipv4
rusty at netfilter.org
rusty at netfilter.org
Tue Mar 29 07:50:50 CEST 2005
Author: rusty at netfilter.org
Date: 2005-03-29 07:50:49 +0200 (Tue, 29 Mar 2005)
New Revision: 3806
Modified:
trunk/nfsim/core/ipv4/ipv4.c
trunk/nfsim/core/ipv4/ipv4.h
Log:
2.6.11 build problem: "user" arg to ip_defrag.
Modified: trunk/nfsim/core/ipv4/ipv4.c
===================================================================
--- trunk/nfsim/core/ipv4/ipv4.c 2005-03-24 14:36:38 UTC (rev 3805)
+++ trunk/nfsim/core/ipv4/ipv4.c 2005-03-29 05:50:49 UTC (rev 3806)
@@ -475,8 +475,17 @@
struct list_head list;
struct sk_buff *frags[20];
};
-static LIST_HEAD(fraglist);
+static struct list_head fraglist[IP_DEFRAG_VS_FWD];
+static void init_fraglist(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(fraglist); i++)
+ INIT_LIST_HEAD(&fraglist[i]);
+}
+init_call(init_fraglist);
+
static struct sk_buff *gather_frag(struct fraglist *f, struct sk_buff *skb)
{
unsigned int i, len, off, max = 0;
@@ -530,11 +539,11 @@
return skb;
}
-struct sk_buff *ip_defrag(struct sk_buff *skb)
+static struct sk_buff *ip_defrag_user(struct sk_buff *skb, u32 user)
{
struct fraglist *i;
- list_for_each_entry(i, &fraglist, list) {
+ list_for_each_entry(i, &fraglist[user], list) {
if (i->frags[0]->nh.iph->saddr != skb->nh.iph->saddr
|| i->frags[0]->nh.iph->daddr != skb->nh.iph->daddr
|| i->frags[0]->nh.iph->protocol!=skb->nh.iph->protocol)
@@ -544,11 +553,23 @@
i = talloc(NULL, struct fraglist);
memset(i->frags, 0, sizeof(i->frags));
i->frags[0] = skb;
- list_add(&i->list, &fraglist);
+ list_add(&i->list, &fraglist[user]);
talloc_steal(i, skb);
return NULL;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
+struct sk_buff *ip_defrag(struct sk_buff *skb)
+{
+ return ip_defrag_user(skb, 0);
+}
+#else
+struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user)
+{
+ return ip_defrag_user(skb, user);
+}
+#endif
+
void ipfrag_flush(void)
{
}
Modified: trunk/nfsim/core/ipv4/ipv4.h
===================================================================
--- trunk/nfsim/core/ipv4/ipv4.h 2005-03-24 14:36:38 UTC (rev 3805)
+++ trunk/nfsim/core/ipv4/ipv4.h 2005-03-29 05:50:49 UTC (rev 3806)
@@ -562,7 +562,25 @@
int ip_route(struct sk_buff *skb);
int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*));
+
+enum ip_defrag_users
+{
+ IP_DEFRAG_LOCAL_DELIVER,
+ IP_DEFRAG_CALL_RA_CHAIN,
+ IP_DEFRAG_CONNTRACK_IN,
+ IP_DEFRAG_CONNTRACK_OUT,
+ IP_DEFRAG_NAT_OUT,
+ IP_DEFRAG_VS_IN,
+ IP_DEFRAG_VS_OUT,
+ IP_DEFRAG_VS_FWD
+};
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
struct sk_buff *ip_defrag(struct sk_buff *skb);
+#else
+struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user);
+#endif
+
void ipfrag_flush(void);
void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info);
More information about the netfilter-cvslog
mailing list