Skip to contentSkip to conversation

Packet cloning

DISCUSSION Bryan Duff 2 participants 2 messages Oct 16, 2009 netfilter

lore
Share & tools
lore

Bryan Duff

author
#0 lore raw

Is it possible to have a CLONE target?

Where matching packets will be cloned and 2 packets will emerge and continue traversing the chain?

Is it as simple as:
struct sk_buff *skb_new = skb_clone(skb, GFP_ATOMIC);
//and then change the prev/next pointers of the sk_buff's appropriately to add them to the list
skb_new->next = skb->next;
skb_new->prev= skb;
skb->next = skb_new;
//and now my packet will be traversing the same chain as the original packet.

I'm sure I'm missing something else that I have to do.

Thanks.

-Bryan

#1 lore raw
Quoted 1 line · Bryan Duff

Is it possible to have a CLONE target?

There is TEE in xtables-addons.

Quoted 2 lines

Where matching packets will be cloned and 2 packets will emerge and continue traversing the chain?

You always have to ask yourself what the purpose of that is supposed to be.