mirror of
https://github.com/soypat/lneto.git
synced 2026-08-20 06:29:03 +00:00
Checksum simplification proposal (#29)
* Simplified checksum calculation and verification * Fixed tests * UDP: using NewBoundedFrame to create a Frame instance limited to the actual frame size. * Minor: renamed some functions * Commented and made more readable consecutive SetCRC calls. * Fixed icmp checksum calculation after rebase * Replaced NewBoundedFrame with explicit validation
This commit is contained in:
@@ -567,6 +567,5 @@ func addr4(addr [4]byte, ok bool) netip.Addr {
|
||||
|
||||
func hash(b []byte) uint16 {
|
||||
var csum lneto.CRC791
|
||||
csum.Write(b)
|
||||
return csum.Sum16()
|
||||
return csum.PayloadSum16(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user