Add more info in android no route error

This commit is contained in:
世界 2022-08-20 09:41:56 +08:00
parent 87dafef2d5
commit ef56e9957f
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -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)
}