mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-17 21:31:04 +03:00
Fix process search skipped for Android again
This commit is contained in:
@@ -29,6 +29,7 @@ type platformInterfaceWrapper struct {
|
||||
useProcFS bool
|
||||
networkManager adapter.NetworkManager
|
||||
myTunName string
|
||||
myTunAddress []netip.Addr
|
||||
defaultInterfaceAccess sync.Mutex
|
||||
defaultInterface *control.Interface
|
||||
isExpensive bool
|
||||
@@ -78,9 +79,25 @@ func (w *platformInterfaceWrapper) OpenInterface(options *tun.Options, platformO
|
||||
}
|
||||
options.FileDescriptor = dupFd
|
||||
w.myTunName = options.Name
|
||||
w.myTunAddress = myTunAddress(options)
|
||||
return tun.New(*options)
|
||||
}
|
||||
|
||||
func myTunAddress(options *tun.Options) []netip.Addr {
|
||||
addresses := make([]netip.Addr, 0, len(options.Inet4Address)+len(options.Inet6Address))
|
||||
for _, prefix := range options.Inet4Address {
|
||||
addresses = append(addresses, prefix.Addr())
|
||||
}
|
||||
for _, prefix := range options.Inet6Address {
|
||||
addresses = append(addresses, prefix.Addr())
|
||||
}
|
||||
return addresses
|
||||
}
|
||||
|
||||
func (w *platformInterfaceWrapper) MyInterfaceAddress() []netip.Addr {
|
||||
return w.myTunAddress
|
||||
}
|
||||
|
||||
func (w *platformInterfaceWrapper) UsePlatformDefaultInterfaceMonitor() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user