Hi, I have an issue when calculating the checksum of two IP headers with ip4_header_checksum function. The content of these two IP headers are exactly the same. The only difference between these 2 IP headers is that, one IP header's address is 64 bits aligned, while the other one is not (My test bed is x86_64). The return value of ip4_header_checksum function for these two IP headers are different. Anyone knows why?
I also wrote a simple test code to test this function. The result is as below: [root@localhost vpp_pdcp]# ./test_ip_checksum ip header 1: 0x45 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfe 0x11 0x0 0x0 0xc0 0xa8 0x32 0x48 0xc0 0xa8 0x32 0x47 ip header 1 address:0x7fff1b1ba1a0, csum 1:0xcd7 ip header 2: 0x45 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xfe 0x11 0x0 0x0 0xc0 0xa8 0x32 0x48 0xc0 0xa8 0x32 0x47 ip header 2 address:0x7fff1b1ba171, csum 2:0x1bc8 Best Regards, Chengqiang Yao
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#9737): https://lists.fd.io/g/vpp-dev/message/9737 Mute This Topic: https://lists.fd.io/mt/22892325/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-