Re: How to copy, modify and send the modified duplicate of an sk_buff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

On 18:28 Tue 21 Jul     , Loránd Jakab wrote:
> Hello,
> 
> I am working on implementing an experimental network protocol. I have 
> netfilter hook which changes the payload after the IP header and the 
> destination IP in packets with a certain protocol id. This part works.
> 
> For some packets, I need to generate an extra packet. To do this, I copy 
> the sk_buff, modify stuff on the copy and try sending it with 
> dev_queue_xmit(), then modify the original and return NF_ACCEPT. The 
> result is: the original get through (the one with NF_ACCEPT) but the 
> copy doesn't.
> 
> Here's the code for copying and sending the copy:
> 
> static void send_payload(struct sk_buff *skb, struct in_addr rloc)

Where do you call this function? Immediately before the ip stack calls
dev_queue_xmit? If not, the ip stack might not have finished building the
packet.

	-Michi 
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux