From 968b9bc217e795d26b3c0f4a5b67f91a10339b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 3 Jun 2024 12:54:54 +0800 Subject: [PATCH] Fix crash on *bsd --- route/router.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/route/router.go b/route/router.go index 484216ee..54f3ac51 100644 --- a/route/router.go +++ b/route/router.go @@ -1121,6 +1121,9 @@ func (r *Router) AutoDetectInterfaceFunc() control.Func { if r.platformInterface != nil && r.platformInterface.UsePlatformAutoDetectInterfaceControl() { return r.platformInterface.AutoDetectInterfaceControl() } else { + if r.interfaceMonitor == nil { + return nil + } return control.BindToInterfaceFunc(r.InterfaceFinder(), func(network string, address string) (interfaceName string, interfaceIndex int, err error) { remoteAddr := M.ParseSocksaddr(address).Addr if C.IsLinux {