From ef56e9957f0d2b4b5d0ab524565ef86b22875def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 20 Aug 2022 09:41:56 +0800 Subject: [PATCH] Add more info in android no route error --- monitor_android.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor_android.go b/monitor_android.go index 2d6f183..735dab9 100644 --- a/monitor_android.go +++ b/monitor_android.go @@ -2,6 +2,7 @@ package tun import ( "github.com/sagernet/netlink" + E "github.com/sagernet/sing/common/exceptions" ) func (m *defaultInterfaceMonitor) checkUpdate() error { @@ -18,7 +19,7 @@ func (m *defaultInterfaceMonitor) checkUpdate() error { } if defaultTableIndex == 0 { - return ErrNoRoute + return E.Extend(ErrNoRoute, "no rule 0xFFFF") } routes, err := netlink.RouteListFiltered(netlink.FAMILY_ALL, &netlink.Route{Table: defaultTableIndex}, netlink.RT_FILTER_TABLE) @@ -46,5 +47,5 @@ func (m *defaultInterfaceMonitor) checkUpdate() error { return nil } - return ErrNoRoute + return E.Extend(ErrNoRoute, "no route in default table ", defaultTableIndex) }