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:
ddirect
2026-02-05 22:35:42 +02:00
committed by GitHub
parent cd51bd6c3f
commit fba97c990a
13 changed files with 139 additions and 228 deletions
+1 -2
View File
@@ -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)
}