From e6f6d35a99e97f54d6bccf38ede7eff18c070d0b Mon Sep 17 00:00:00 2001 From: kari-ts <135075563+kari-ts@users.noreply.github.com> Date: Thu, 2 May 2024 06:26:33 -0700 Subject: [PATCH] android: bump oss and fix missing net/interfaces (#363) Update net/interfaces to netmon per https://github.com/tailscale/tailscale/pull/11901 Signed-off-by: kari-ts --- go.mod | 4 ++-- go.sum | 3 +++ libtailscale/net.go | 10 +++++----- libtailscale/tailscale.go | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6ad91e6..673a753 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,11 @@ module github.com/tailscale/tailscale-android go 1.22.0 require ( - github.com/tailscale/wireguard-go v0.0.0-20240413175505-64040e66467d + github.com/tailscale/wireguard-go v0.0.0-20240429185444-03c5a0ccf754 golang.org/x/mobile v0.0.0-20240319015410-c58ccf4b0c87 golang.org/x/sys v0.18.0 inet.af/netaddr v0.0.0-20220617031823-097006376321 - tailscale.com v1.65.0-pre.0.20240426213511-71e9258ad946 + tailscale.com v1.65.0-pre.0.20240501220321-96712e10a773 ) require ( diff --git a/go.sum b/go.sum index e7e37a4..6c0d5ef 100644 --- a/go.sum +++ b/go.sum @@ -156,6 +156,7 @@ github.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1 h1:t github.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1/go.mod h1:agQPE6y6ldqCOui2gkIh7ZMztTkIQKH049tv8siLuNQ= github.com/tailscale/wireguard-go v0.0.0-20240413175505-64040e66467d h1:IREg0cn4nDyMjnqTgPacjgl66qDYmoOnt1k/vb96ius= github.com/tailscale/wireguard-go v0.0.0-20240413175505-64040e66467d/go.mod h1:BOm5fXUBFM+m9woLNBoxI9TaBXXhGNP50LX/TGIvGb4= +github.com/tailscale/wireguard-go v0.0.0-20240429185444-03c5a0ccf754/go.mod h1:BOm5fXUBFM+m9woLNBoxI9TaBXXhGNP50LX/TGIvGb4= github.com/tailscale/xnet v0.0.0-20240117122442-62b9a7c569f9 h1:81P7rjnikHKTJ75EkjppvbwUfKHDHYk6LJpO5PZy8pA= github.com/tailscale/xnet v0.0.0-20240117122442-62b9a7c569f9/go.mod h1:orPd6JZXXRyuDusYilywte7k094d7dycXXU5YnWsrwg= github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA= @@ -262,3 +263,5 @@ tailscale.com v1.65.0-pre.0.20240426190311-745931415c58 h1:jaNg4PNudNUA/QeYBS8S5 tailscale.com v1.65.0-pre.0.20240426190311-745931415c58/go.mod h1:UPEw7cAt2akD8W6uPaiIBx2EFxCKmrJJ7qMnqCsyE/4= tailscale.com v1.65.0-pre.0.20240426213511-71e9258ad946 h1:9aOJEEsTLoAAUWZsaKAdo6xEr8oaosM1aVm8FsX0MIQ= tailscale.com v1.65.0-pre.0.20240426213511-71e9258ad946/go.mod h1:UPEw7cAt2akD8W6uPaiIBx2EFxCKmrJJ7qMnqCsyE/4= +tailscale.com v1.65.0-pre.0.20240501220321-96712e10a773 h1:HQwBY5liviGu/APB0p1enwmysKwttOoNyQmu10YZBAg= +tailscale.com v1.65.0-pre.0.20240501220321-96712e10a773/go.mod h1:OTjEWwKfz2AsG1gpvlLHzMdDNpTwyqh5uBTQCVDe+do= diff --git a/libtailscale/net.go b/libtailscale/net.go index 4165b0b..ec3f60f 100644 --- a/libtailscale/net.go +++ b/libtailscale/net.go @@ -17,7 +17,7 @@ import ( "golang.org/x/sys/unix" "inet.af/netaddr" "tailscale.com/net/dns" - "tailscale.com/net/interfaces" + "tailscale.com/net/netmon" "tailscale.com/util/dnsname" "tailscale.com/wgengine/router" ) @@ -34,8 +34,8 @@ var errVPNNotPrepared = errors.New("VPN service not prepared or was revoked") var errMultipleUsers = errors.New("VPN cannot be created on this device due to an Android bug with multiple users") // Report interfaces in the device in net.Interface format. -func (a *App) getInterfaces() ([]interfaces.Interface, error) { - var ifaces []interfaces.Interface +func (a *App) getInterfaces() ([]netmon.Interface, error) { + var ifaces []netmon.Interface ifaceString, err := a.appCtx.GetInterfacesAsString() if err != nil { @@ -68,7 +68,7 @@ func (a *App) getInterfaces() ([]interfaces.Interface, error) { continue } - newIf := interfaces.Interface{ + newIf := netmon.Interface{ Interface: &net.Interface{ Name: name, Index: index, @@ -242,7 +242,7 @@ func (b *backend) NetworkChanged(ifname string) { }() // Set the interface name and alert the monitor. - interfaces.UpdateLastKnownDefaultRouteInterface(ifname) + netmon.UpdateLastKnownDefaultRouteInterface(ifname) if b.sys != nil { if nm, ok := b.sys.NetMon.GetOK(); ok { nm.InjectEvent() diff --git a/libtailscale/tailscale.go b/libtailscale/tailscale.go index 7a2642c..b18b547 100644 --- a/libtailscale/tailscale.go +++ b/libtailscale/tailscale.go @@ -15,7 +15,7 @@ import ( "tailscale.com/logpolicy" "tailscale.com/logtail" "tailscale.com/logtail/filch" - "tailscale.com/net/interfaces" + "tailscale.com/net/netmon" "tailscale.com/types/logger" "tailscale.com/types/logid" "tailscale.com/util/clientmetric" @@ -39,7 +39,7 @@ func newApp(dataDir, directFileRoot string, appCtx AppContext) Application { a.ready.Add(1) a.store = newStateStore(a.appCtx) - interfaces.RegisterInterfaceGetter(a.getInterfaces) + netmon.RegisterInterfaceGetter(a.getInterfaces) syspolicy.RegisterHandler(syspolicyHandler{a: a}) go func() { defer func() {