Netdev List
 help / color / mirror / Atom feed
* skb_copy/clone question
@ 2009-08-26 15:07 Chris Ross
  0 siblings, 0 replies; only message in thread
From: Chris Ross @ 2009-08-26 15:07 UTC (permalink / raw)
  To: netdev

I have a driver that generate N packets to send for every 1 it
receives, similar to a bridge in functionality. I need to insert a
slightly different header for each output packet. My current approach
which is causing some issues is ..

send_packet(struct sk_buff* skb)
{
  if (skb_cow_head(skb, some_val) < 0)
    goto error_condition;

  .. insert header ..

  .. set skb->dst, and ident ..

  ip_local_out(skb)
}

// main section
for each egress packet
{
  // skb->len is always > 0 here
  if ((tskb = pskb_copy(skb, GFP_ATOMIC)) == NULL)
    goto error_condition;

  // tskb->len seems to be 0 here
  send_packet(tskb)
}

I've played with both pskb_copy and skb_copy and both seem to result
in a packet with len of 0. I was expecting skb->len to be equivalent
to tskb->len. I am running 2.6.29, any pointers would be appreciated.

thanks,

-chris

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-26 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 15:07 skb_copy/clone question Chris Ross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox