mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
Provide default route to Tailscale
This commit is contained in:
@@ -306,6 +306,20 @@ func (t *Endpoint) start(scope *adapter.Scope) error {
|
||||
netmon.RegisterInterfaceGetter(nil)
|
||||
return nil
|
||||
})
|
||||
netmon.SetDefaultRouteFunc(func() (netmon.DefaultRouteDetails, error) {
|
||||
defaultInterface := t.network.InterfaceMonitor().DefaultInterface()
|
||||
if defaultInterface == nil {
|
||||
return netmon.DefaultRouteDetails{}, nil
|
||||
}
|
||||
return netmon.DefaultRouteDetails{
|
||||
InterfaceName: defaultInterface.Name,
|
||||
InterfaceIndex: defaultInterface.Index,
|
||||
}, nil
|
||||
})
|
||||
scope.Add(func() error {
|
||||
netmon.SetDefaultRouteFunc(nil)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
if t.systemInterface {
|
||||
mtu := t.systemInterfaceMTU
|
||||
|
||||
Reference in New Issue
Block a user