I want to modify the content of a packet in a kernel module.
I get this packet using NF_PRE_RPOUTING HOOK.
I have a pointer to the buffer (sk_buf).
What I need is to achieve is this:
- create a new IP header.
- create a new UDP header.
- Afterwards, the new payload should start. It should contain one new field (integer, 4 bytes)
,which is a serial number, and than the original IP header and the original UDP header
and then the original payload.
- Any ideas if it is possible to implement such a thing ?
- Any advice will be greatly appreciated.