netdev
[Top] [All Lists]

skb_copy() for private linear skb->data

To: "'netdev@xxxxxxxxxxx'" <netdev@xxxxxxxxxxx>
Subject: skb_copy() for private linear skb->data
From: "Memon, Mazhar I" <mimemon@xxxxxxxxxx>
Date: Thu, 27 Jun 2002 10:52:38 -0600
Sender: owner-netdev@xxxxxxxxxxx
According to the comment above skb_copy():
"As by-product this function converts non-linear &sk_buff to linear one, so
that &sk_buff becomes completely private and caller is allowed to modify all
the data of returned buffer. "
So in order to do some sort  of  data transformation on skb->data:
new_skb = skb_copy(skb, GFP_ATOMIC);
encrypt(new_skb->data)
<nuke skb>                      with skb_unlink(skb)?
<send new_skb>          with dev_kfree_skb(new_skb)?
This causes an oops.
Or instead of nuking, and sending, should the list pointers of the two skb's
be swapped so that the new_skb appears in the list where 'skb' once lived,
and then kfree(skb)?  I've tried to find an answer to this simple question
in many places without luck.  Also, I cannot use skb_linearize, since not
all data is made private to the caller.

-Mazhar



<Prev in Thread] Current Thread [Next in Thread>
  • skb_copy() for private linear skb->data, Memon, Mazhar I <=