Skip to contentSkip to conversation

how to replace a skb in NF_IP_LOCAL_OUT hook

DISCUSSION jywang 1 participant 1 message Nov 4, 2005

lore
Share & tools
lore

jywang

author
#0 lore raw
Quoted 1 line

i want to replace the skb with my own, and in my skb i will change the

data

Quoted 7 lines

in it.

How to do it?

what i do as below:

cp = skb_copy_expand(*skb, skb_headroom(*skb)+12, skb_tailroom(*skb),

GFP_ATOMIC);

Quoted 6 lines

//change the skb->data here
skb_set_owner_w(cp, (*skb)->sk);
*skb = cp;
return NF_ACCEPT;

but, it can't work.