mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-27 03:55:36 +00:00
20 lines
365 B
Go
20 lines
365 B
Go
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
|
||
|
package tstun
|
||
|
|
||
|
import (
|
||
|
"github.com/tailscale/wireguard-go/tun"
|
||
|
"tailscale.com/envknob"
|
||
|
)
|
||
|
|
||
|
func setLinkFeatures(dev tun.Device) error {
|
||
|
if envknob.Bool("TS_TUN_DISABLE_UDP_GRO") {
|
||
|
linuxDev, ok := dev.(tun.LinuxDevice)
|
||
|
if ok {
|
||
|
linuxDev.DisableUDPGRO()
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|