mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 00:21:30 +00:00
Fix crash on *bsd
This commit is contained in:
parent
69dc87aa6d
commit
968b9bc217
|
@ -1121,6 +1121,9 @@ func (r *Router) AutoDetectInterfaceFunc() control.Func {
|
||||||
if r.platformInterface != nil && r.platformInterface.UsePlatformAutoDetectInterfaceControl() {
|
if r.platformInterface != nil && r.platformInterface.UsePlatformAutoDetectInterfaceControl() {
|
||||||
return r.platformInterface.AutoDetectInterfaceControl()
|
return r.platformInterface.AutoDetectInterfaceControl()
|
||||||
} else {
|
} else {
|
||||||
|
if r.interfaceMonitor == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return control.BindToInterfaceFunc(r.InterfaceFinder(), func(network string, address string) (interfaceName string, interfaceIndex int, err error) {
|
return control.BindToInterfaceFunc(r.InterfaceFinder(), func(network string, address string) (interfaceName string, interfaceIndex int, err error) {
|
||||||
remoteAddr := M.ParseSocksaddr(address).Addr
|
remoteAddr := M.ParseSocksaddr(address).Addr
|
||||||
if C.IsLinux {
|
if C.IsLinux {
|
||||||
|
|
Loading…
Reference in a new issue