refactor(beacon, osutil, upnp, netutil): only use anet on Android (#10211)
Add a wrapper that uses anet on Android, but net on other platforms. ### Purpose Fixes https://forum.syncthing.net/t/workaround-for-android-local-discovery/20403/12 ### Testing Run two Syncthing instances with Global Discovery disabled. Pair them with each other, don't hardcode their addresses, and verify they connect.
This commit is contained in:
@@ -40,7 +40,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/wlynxg/anet"
|
||||
"github.com/syncthing/syncthing/lib/netutil"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/nat"
|
||||
)
|
||||
@@ -67,7 +67,7 @@ func (s *IGDService) AddPinhole(ctx context.Context, protocol nat.Protocol, intA
|
||||
return nil, errors.New("no interface")
|
||||
}
|
||||
|
||||
addrs, err := anet.InterfaceAddrsByInterface(s.Interface)
|
||||
addrs, err := netutil.InterfaceAddrsByInterface(s.Interface)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user