netdev
[Top] [All Lists]

RE: skb allocation problems

To: Imran.Patel@xxxxxxxxx
Subject: RE: skb allocation problems
From: Imran.Patel@xxxxxxxxx
Date: Wed, 18 Apr 2001 18:31:25 +0300
Cc: netdev@xxxxxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
> Try poisoning the packet in __kfree_skb() (or skb_headerinit()):
> 
>       skb->head = skb->data = skb->tail = skb->end = NULL;
> 
> This will catch almost anyone using a freed packet, and you'll get a
> OOPS in the right place.


I guess i have figured out what might be causing the problem. Actually i was
doing something like this in my NAT-PT module:

// get the packet at the pre-routing hook

skb_unlink(ipv4_skb);

// do the translation

ipv6_skb = alloc_skb(.....

kfree_skb(ipv4_skb);
return NF_STOLEN;

When i removed the skb_unlink statement, everything started to work
fine....no longer do i get the memory overlap between ipv4_skb and
ipv6_skb.....So is it something like that when i unlink the skb it is
available for re-use??? If it is not something like that then the problem
might be because of something else....

btw, even when i removed my (faulty!) module, the kernel was behaving in a
nasty manner and i got corrupted ping packets (as i reported on the list
earlier)


imran







> 
> Hope that helps,
> Rusty.
> --
> Premature optmztion is rt of all evl. --DK
> 

<Prev in Thread] Current Thread [Next in Thread>