This is 2 example: How to append data on a packet from kernel space? How to route the splitted packets using netfilter hooks in kernel space I just want change data coming server at hook LOCAL_IN, this is similar spllitted example. At append data example, that is ok. But splitted example, that is not work. I think problem is update length, checksum udp,ip packet(example: the value offset in calculating checksum at hook LOCAL_IN and LOCAL_OUT is different( int offset = skb_transport_offset(skb)) because when a packet goes in, packet is processed before go to udp layer).I try to alter htons -> ntohs but that is not work.
Anyone have idea to solve? Thanks