Ingo> When doing 'ping -f localhost', and 'tcpdump -i lo', tcpdump
Ingo> occasionally segfaults under 2.1.12.
Ingo> the same thing works with 0 problems on 2.1.8. Dont have
Ingo> IPV6 turned on. Let me know if you cant reproduce it and
Ingo> need more info.
Ingo> -- mingo
Please try this, it should eliminate problems with multiple skb_clones
i hope.
./Pedro.
Index: net/core/skbuff.c
===================================================================
RCS file: /public/cvsroot/linux/net/core/skbuff.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 skbuff.c
--- skbuff.c 1996/11/19 13:40:46 1.1.1.5
+++ skbuff.c 1996/11/23 13:39:55
@@ -735,12 +735,17 @@
/* don't do anything if somebody still uses us */
if (atomic_dec_and_test(&skb->count)) {
+
+ int free_head;
+
+ free_head = (skb->inclone != SKB_CLONE_INLINE);
+
/* free the skb that contains the actual data if we've clone()'d */
if (skb->data_skb) {
addr = skb;
__kfree_skbmem(skb->data_skb);
}
- if (!skb->inclone)
+ if (free_head)
kfree(addr);
atomic_dec(&net_skbcount);
}
@@ -761,7 +766,8 @@
{
n = ((struct sk_buff *) skb->end) - 1;
skb->end -= sizeof(struct sk_buff);
- inbuff = 1;
+ skb->inclone = SKB_CLONE_ORIG;
+ inbuff = SKB_CLONE_INLINE;
}
else
{
Index: include/linux/skbuff.h
===================================================================
RCS file: /public/cvsroot/linux/include/linux/skbuff.h,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 skbuff.h
--- skbuff.h 1996/11/19 13:39:36 1.1.1.4
+++ skbuff.h 1996/11/23 13:42:55
@@ -125,6 +125,8 @@
void (*destructor)(struct sk_buff *); /* Destruct function */
__u16 redirport; /* Redirect port */
__u16 inclone; /* Inline clone */
+#define SKB_CLONE_ORIG 1
+#define SKB_CLONE_INLINE 2
};
#ifdef CONFIG_SKB_LARGE