mirror of https://github.com/tailscale/tailscale/
Merge e0fab89a07
into 7d9c3f9897
commit
a9dfaefb72
@ -0,0 +1,22 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package tstun
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/tailscale/wireguard-go/tun"
|
||||
)
|
||||
|
||||
func setLinkFeatures(dev tun.Device) error {
|
||||
val := os.Getenv("TS_TUN_DISABLE_UDP_GRO")
|
||||
if strings.ToLower(val) == "true" || val == "1" {
|
||||
linuxDev, ok := dev.(tun.LinuxDevice)
|
||||
if ok {
|
||||
linuxDev.DisableUDPGRO()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !linux
|
||||
|
||||
package tstun
|
||||
|
||||
import (
|
||||
"github.com/tailscale/wireguard-go/tun"
|
||||
)
|
||||
|
||||
func setLinkFeatures(dev tun.Device) error {
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue