in layers/tcpip.go
func tcpipChecksum(data []byte, csum uint32) uint16 {
....
if len(data)%2 == 1 {
csum += uint32(data[length] << 8)
}
....
It should be
csum += uint32(data[length]) << 8
Because a byte shift 8bits is 0.
I found this bug when my packet can't pass windows tcp/ip stack.
and wireshark found checksum invalid.
in file `c.pkt`. the correct checksum is a73a. before modify code is b13a.
Original issue reported on code.google.com by cfanfrank@gmail.com on 5 Nov 2013 at 2:07
Original issue reported on code.google.com by
cfanfrank@gmail.com
on 5 Nov 2013 at 2:07Attachments: