Messages in this thread | | | Date | Tue, 3 Feb 2004 11:49:40 +0200 | From | Muli Ben-Yehuda <> | Subject | Re: Freeing skbuff (was: Re: Sending built-by-hand packet and kernel panic.) |
| |
On Mon, Feb 02, 2004 at 07:51:47PM +0200, Emmanuel Guiton wrote:
> However, my overall problem is not solved. As far as my investigations > led me, my sk_buff structure is never released after having been sent on > the wire. So I guess I need an explicit destructor function in my > sk_buff as the following is present in the definition of struct sk_buff: > void (*destructor)(struct sk_buff *); /* Destruct function */
Note that depending on what you're doing, you might not be able to use the destructor, because the upper layers use it without regards to whether it was set before. To the best of my understanding, the rules for the destructor say that it is free for the use of whatever layer owns the skbuff at the moment. There are three ways around it - the first and obvious is to avoid relying on the destructor. The second is that you can use skb_clone() to get your own copy of the headers and the destructor (but that doesn't really help you because how does the layer that ends up freeing the skb know to use your version of the headers?) and the third is to use this patch, http://www.mulix.org/patches/skb-destructor-chaining-A2-2.6.1, to allow more than destructor per skb.
Hope this helps, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
"the nucleus of linux oscillates my world" - gccbot@#offtopic
[unhandled content-type:application/pgp-signature] | |