mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-26 20:29:03 +03:00
Handle TUN loopback in direct outbound
This commit is contained in:
@@ -189,8 +189,8 @@ func (s *interfaceMonitorStub) UnregisterCallback(element *list.Element[tun.Defa
|
||||
func (s *interfaceMonitorStub) RegisterMyInterface(interfaceName string) {
|
||||
}
|
||||
|
||||
func (s *interfaceMonitorStub) MyInterface() string {
|
||||
return ""
|
||||
func (s *interfaceMonitorStub) MyInterfaces() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func FormatConfig(configContent string) (*StringBox, error) {
|
||||
|
||||
@@ -15,9 +15,9 @@ var (
|
||||
|
||||
type platformDefaultInterfaceMonitor struct {
|
||||
*platformInterfaceWrapper
|
||||
logger logger.Logger
|
||||
callbacks list.List[tun.DefaultInterfaceUpdateCallback]
|
||||
myInterface string
|
||||
logger logger.Logger
|
||||
callbacks list.List[tun.DefaultInterfaceUpdateCallback]
|
||||
myInterfaces []string
|
||||
}
|
||||
|
||||
func (m *platformDefaultInterfaceMonitor) Start() error {
|
||||
@@ -106,11 +106,11 @@ func (m *platformDefaultInterfaceMonitor) updateDefaultInterface(interfaceName s
|
||||
func (m *platformDefaultInterfaceMonitor) RegisterMyInterface(interfaceName string) {
|
||||
m.defaultInterfaceAccess.Lock()
|
||||
defer m.defaultInterfaceAccess.Unlock()
|
||||
m.myInterface = interfaceName
|
||||
m.myInterfaces = append(m.myInterfaces, interfaceName)
|
||||
}
|
||||
|
||||
func (m *platformDefaultInterfaceMonitor) MyInterface() string {
|
||||
func (m *platformDefaultInterfaceMonitor) MyInterfaces() []string {
|
||||
m.defaultInterfaceAccess.Lock()
|
||||
defer m.defaultInterfaceAccess.Unlock()
|
||||
return m.myInterface
|
||||
return m.myInterfaces
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user