Closed buptczq closed 5 years ago
The checksum of echo packet is set here for raw socket: https://github.com/google/netstack/blob/fe7dc3818d9b08d736b27c462a7de273c0fdbd27/tcpip/network/ipv4/icmp.go#L91-L93
The checksum of reply packet is calculated here without clearing the checksum in header: https://github.com/google/netstack/blob/fe7dc3818d9b08d736b27c462a7de273c0fdbd27/tcpip/network/ipv4/icmp.go#L99-L101
Is it should be written as the following?
pkt.SetType(header.ICMPv4EchoReply) // Clear the checksum pkt.SetChecksum(0) pkt.SetChecksum(^header.Checksum(pkt, header.ChecksumVV(vv, 0)))
Do you mind refiling this under github.com/google/gvisor. This repo is a read-only fork of the netstack included in gVisor. This repo is not usually actively monitored nor do we directly commit to this repo.
The checksum of echo packet is set here for raw socket: https://github.com/google/netstack/blob/fe7dc3818d9b08d736b27c462a7de273c0fdbd27/tcpip/network/ipv4/icmp.go#L91-L93
The checksum of reply packet is calculated here without clearing the checksum in header: https://github.com/google/netstack/blob/fe7dc3818d9b08d736b27c462a7de273c0fdbd27/tcpip/network/ipv4/icmp.go#L99-L101
Is it should be written as the following?