Relative Content

Tag Archive for clinux-kernelnetfilter

How to correctly calculate TCP checksum in kernel

I want to implement a traffic forwarder through netfilter to forward 0.0.0.0:8080 to the intranet 127.0.0.1:80. The problem is that when the checksum is calculated after modifying the TCP and IP data in the NF_INET_PRE_ROUTING stage, some of the calculated checksum values ​​are correct and some are incorrect.