Re: TCP bug?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 27 Oct 1998 16:32:18 +0000 (GMT)


> Does this mean that it is safe now in 2.1 to change the skbuff's
> contents by the driver without confusing upper layers (bogus :-)
> retransmit mechanism? This would mean I could re-enable an
> optimiziation in CIPE I had to take out for 2.0 because of exactly the
> problem described above.

Short answer no,

Long answer yes but..

If you change the body of an sk_buff you are passed it may be shared
and you need to do

skb2=skb_unshare(skb, GFP_ATOMIC);
if(skb2==NULL)
{
kfree(skb);
return -1; /* or whatever */
}

/* Now scribble */

skb_unshare is a copy on write for multiple users. So 99.99% of the time it
actually just returns skb.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/