mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
Fix process search skipped for TUN
This commit is contained in:
@@ -184,6 +184,12 @@ func (d *DefaultDialer) listenSerialInterfacePacket(ctx context.Context, listene
|
||||
|
||||
func selectInterfaces(networkManager adapter.NetworkManager, strategy C.NetworkStrategy, interfaceType []C.InterfaceType, fallbackInterfaceType []C.InterfaceType) (primaryInterfaces []adapter.NetworkInterface, fallbackInterfaces []adapter.NetworkInterface) {
|
||||
interfaces := networkManager.NetworkInterfaces()
|
||||
myInterface := networkManager.InterfaceMonitor().MyInterface()
|
||||
if myInterface != "" {
|
||||
interfaces = common.Filter(interfaces, func(it adapter.NetworkInterface) bool {
|
||||
return it.Name != myInterface
|
||||
})
|
||||
}
|
||||
switch strategy {
|
||||
case C.NetworkStrategyDefault:
|
||||
if len(interfaceType) == 0 {
|
||||
|
||||
@@ -103,14 +103,11 @@ func (w *platformInterfaceWrapper) NetworkInterfaces() ([]adapter.NetworkInterfa
|
||||
}
|
||||
var interfaces []adapter.NetworkInterface
|
||||
for _, netInterface := range iteratorToArray[*NetworkInterface](interfaceIterator) {
|
||||
if netInterface.Name == w.myTunName {
|
||||
continue
|
||||
}
|
||||
w.defaultInterfaceAccess.Lock()
|
||||
// (GOOS=windows) SA4006: this value of `isDefault` is never used
|
||||
// Why not used?
|
||||
//nolint:staticcheck
|
||||
isDefault := w.defaultInterface != nil && int(netInterface.Index) == w.defaultInterface.Index
|
||||
isDefault := netInterface.Name != w.myTunName && w.defaultInterface != nil && int(netInterface.Index) == w.defaultInterface.Index
|
||||
w.defaultInterfaceAccess.Unlock()
|
||||
interfaces = append(interfaces, adapter.NetworkInterface{
|
||||
Interface: control.Interface{
|
||||
|
||||
@@ -40,9 +40,13 @@ func NewNetworkInterfaceAddressItem(networkManager adapter.NetworkManager, inter
|
||||
|
||||
func (r *NetworkInterfaceAddressItem) Match(metadata *adapter.InboundContext) bool {
|
||||
interfaces := r.networkManager.NetworkInterfaces()
|
||||
myInterface := r.networkManager.InterfaceMonitor().MyInterface()
|
||||
match:
|
||||
for ifType, addresses := range r.interfaceAddresses {
|
||||
for _, networkInterface := range interfaces {
|
||||
if networkInterface.Name == myInterface {
|
||||
continue
|
||||
}
|
||||
if networkInterface.Type != ifType {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user