why set tcp check CSUM_MANGLED_0?

孙建希 ycsunjane at gmail.com
Mon Aug 28 07:11:48 EDT 2017


all:

I am reading tcp checksum code.

uh->check = csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, csum);
if (uh->check == 0)
    uh->check = CSUM_MANGLED_0;

#define CSUM_MANGLED_0 ((__force __sum16)0xffff)


uh->check will be 0, but will never be 0xFFFF. Why  set uh->check to
CSUM_MANGLED_0?



More information about the Kernelnewbies mailing list