mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
19 lines
408 B
Go
19 lines
408 B
Go
//go:build with_gvisor
|
|
|
|
package tailscale
|
|
|
|
import (
|
|
"github.com/sagernet/sing-box/adapter"
|
|
"github.com/sagernet/tailscale/net/netns"
|
|
)
|
|
|
|
func setAndroidProtectFunc(platformInterface adapter.PlatformInterface) {
|
|
if platformInterface != nil {
|
|
netns.SetAndroidProtectFunc(func(fd int) error {
|
|
return platformInterface.AutoDetectInterfaceControl(fd)
|
|
})
|
|
} else {
|
|
netns.SetAndroidProtectFunc(nil)
|
|
}
|
|
}
|