tun: export optimized IP checksum funcs

External implementers of tun.Device may support GRO, requiring checksum
offload.

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited 2024-07-23 13:34:34 -07:00 committed by Jordan Whited
parent 60eeedfd62
commit 6c039a188c
5 changed files with 23 additions and 18 deletions

View file

@ -7,7 +7,7 @@ package tun
import "strconv"
func checksum(data []byte, initial uint16) uint16 {
func Checksum(data []byte, initial uint16) uint16 {
if strconv.IntSize < 64 {
return checksumGeneric32(data, initial)
}