Pointers for writing packet mangling modules
Hi,
I have been experimenting with a module for altering the destination IP address for all packets on a given port at the PRE_ROUTING stage (don’t worry - I know this is something easily done with IPTables). Unfortunately, any examples/tutorials dealing with writing modules that use Netfilter always fall short of describing the necessary steps to take when altering the skbuff.
Are the following steps necessary (judging from the NAT source code)?
Calling skb_ip_make_writable
Recalculating ip checksum
Calling dst_release
What else am I missing?
Thanks,
Brian