Handle TUN loopback in direct outbound

This commit is contained in:
世界
2026-06-03 10:37:53 +08:00
parent 1086ab2563
commit 761b7f4e12
8 changed files with 77 additions and 19 deletions

View File

@@ -40,11 +40,11 @@ func NewNetworkInterfaceAddressItem(networkManager adapter.NetworkManager, inter
func (r *NetworkInterfaceAddressItem) Match(metadata *adapter.InboundContext) bool {
interfaces := r.networkManager.NetworkInterfaces()
myInterface := r.networkManager.InterfaceMonitor().MyInterface()
myInterfaces := r.networkManager.InterfaceMonitor().MyInterfaces()
match:
for ifType, addresses := range r.interfaceAddresses {
for _, networkInterface := range interfaces {
if networkInterface.Name == myInterface {
if common.Contains(myInterfaces, networkInterface.Name) {
continue
}
if networkInterface.Type != ifType {