Fix interface monitor for android

This commit is contained in:
世界
2023-04-18 14:04:09 +08:00
parent 20e9da5c67
commit b498a22972
10 changed files with 342 additions and 29 deletions

View File

@@ -119,7 +119,7 @@ func (t *Transport) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg,
func (t *Transport) fetchInterface() (*net.Interface, error) {
interfaceName := t.interfaceName
if t.autoInterface {
if t.router.NetworkMonitor() == nil {
if t.router.InterfaceMonitor() == nil {
return nil, E.New("missing monitor for auto DHCP, set route.auto_detect_interface")
}
interfaceName = t.router.InterfaceMonitor().DefaultInterfaceName(netip.Addr{})