skb_copy/clone question
From: Chris Ross <hidden>
Date: 2009-08-26 15:07:57
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