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:
parent
60eeedfd62
commit
6c039a188c
5 changed files with 23 additions and 18 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue