Skip to contentSkip to conversation

How can I add data to a packet before sending it?

DISCUSSION Akshay Kawale 1 participant 1 message Apr 3, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to add data to a packet by expanding the tailroom using skb_copy_expand()

I am using the following statements:
*skb = skb_copy_expand(*skb, 0, 256, GFP_ATOMIC);

I am calling this in the NF_IP_LOCAL_OUT hook, and does not give any errors if I drop the packet in the NF_IP_POST_ROUTING hook.

However if I don't drop the packet, I get a kernel panic.

I am running Fedora Core 1.
Please let me know how I can achieve this.

Thanks.

- Akshay