netdev
[Top] [All Lists]

Re: skb_linearize needs fixing?

To: rusty@xxxxxxxxxxxxxxxx (Rusty Russell)
Subject: Re: skb_linearize needs fixing?
From: kuznet@xxxxxxxxxxxxx
Date: Tue, 19 Dec 2000 17:40:54 +0300 (MSK)
Cc: netdev@xxxxxxxxxxx, davem@xxxxxxxxxx, anton@xxxxxxxxxxxxx, ak@xxxxxx
In-reply-to: <E1489oN-0000Tf-00@halfway> from "Rusty Russell" at Dec 19, 0 10:35:19 am
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> At the moment netfilter does a skb_linearize(), and the ip_queue_xmit2
> dereferences skb->sk.  Boom (thanks Anton).

Boom, agreed.

But what did you make with NAT earlier, when you also need to copy skb?
It is puzzle for me.


> skb_linearize is different from skb_copy: it should copy the sk, list
> and the destructor

This is impossible to do in core. Kind of ownership is known only
from context. Users used to set correct ownership of cloned/copied
buffers themselves, which in the case of netfilter happens always
write destructor.


> return an int, and not free the old skb on failure (ie. int
> skb_linearize(struct sk_buff **pskb)).

And what are you going to do with this skb after failure? 8)
It is clear: to free it, you have no more variants.

Apparently, you want to do plain skb_copy to copy ownership.
Yes, seems, the function copying write ownership should be exported too.

> Oh, and inlining it seems, um, questionable.

One line function is to be inlined, is not it?

Alexey

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