The order of events:
1. stored sk_buff data is modified in a reversible fashion (i.e. modified data is saved and restored after transmission).
2. sk_buff is queued for transmission
3. control returns back to interrupt handler. (yeah, this is all in soft_irq context, so I need it to be fast)
4. modified sk_buff data is restored, without knowing if the buffer has left the transmit queue and actually been put on the link.
So, there's a chance that: the modified data will get restored into the buffer before the actually transmission actually takes place.
I guess when exactly the packet is sent out on the wire will depend on the queuing policies and the device driver.
What you can do is make a copy of the skb and modify that copy. So the modified copy will be transmitted & the unmodified copy will be passed to the network layer. But again kmalloc()'ing a new skb & making a copy will be a problem since you are in interrupt context.
--Swapnil
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/