[client] Add netstack support for Android cli (#4319)

This commit is contained in:
plusls
2025-08-26 21:40:01 +08:00
committed by GitHub
parent 3488a516c9
commit 9f84165763
6 changed files with 38 additions and 5 deletions

View File

@@ -4,6 +4,8 @@ import (
"fmt"
"sync"
"syscall"
"github.com/netbirdio/netbird/client/iface/netstack"
)
var (
@@ -19,6 +21,9 @@ func SetAndroidProtectSocketFn(fn func(fd int32) bool) {
// ControlProtectSocket is a Control function that sets the fwmark on the socket
func ControlProtectSocket(_, _ string, c syscall.RawConn) error {
if netstack.IsEnabled() {
return nil
}
var aErr error
err := c.Control(func(fd uintptr) {
androidProtectSocketLock.Lock()