Networking Forums

Networking Forums > Computer Networking > Linux Networking > pskb_copy

Reply
 
 
shavian78@gmail.com
Guest
Posts: n/a

 
      04-12-2005, 05:57 AM
Hi , I am trying to understand what exactly pskb_copy is doing. From
the comment above the code, I understand that it makes a private copy
of the header in the new skb but does not copy the data, eg for TCP
packets it will copy the tcp, ip header etc in the new skb (using
memcpy) but will not copy the data.

But then in the code, it seems to be allocating :

struct sk_buff *n = alloc_skb(skb->end - skb->head, gfp_mask);

ie it seems to be allocating space for the whole data portion on the
original skb (protocol headers + data).

If the intention is just to copy the protocol headers, then why
allocate space for protocol headers + protocol data ?

Shavian..

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11