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 <kari@tailscale.com>
pull/364/head
kari-ts 2 years ago committed by GitHub
parent 5e3236260f
commit e6f6d35a99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3,11 +3,11 @@ module github.com/tailscale/tailscale-android
go 1.22.0 go 1.22.0
require ( 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/mobile v0.0.0-20240319015410-c58ccf4b0c87
golang.org/x/sys v0.18.0 golang.org/x/sys v0.18.0
inet.af/netaddr v0.0.0-20220617031823-097006376321 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 ( require (

@ -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/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 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-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 h1:81P7rjnikHKTJ75EkjppvbwUfKHDHYk6LJpO5PZy8pA=
github.com/tailscale/xnet v0.0.0-20240117122442-62b9a7c569f9/go.mod h1:orPd6JZXXRyuDusYilywte7k094d7dycXXU5YnWsrwg= github.com/tailscale/xnet v0.0.0-20240117122442-62b9a7c569f9/go.mod h1:orPd6JZXXRyuDusYilywte7k094d7dycXXU5YnWsrwg=
github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA= 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.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 h1:9aOJEEsTLoAAUWZsaKAdo6xEr8oaosM1aVm8FsX0MIQ=
tailscale.com v1.65.0-pre.0.20240426213511-71e9258ad946/go.mod h1:UPEw7cAt2akD8W6uPaiIBx2EFxCKmrJJ7qMnqCsyE/4= 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=

@ -17,7 +17,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"inet.af/netaddr" "inet.af/netaddr"
"tailscale.com/net/dns" "tailscale.com/net/dns"
"tailscale.com/net/interfaces" "tailscale.com/net/netmon"
"tailscale.com/util/dnsname" "tailscale.com/util/dnsname"
"tailscale.com/wgengine/router" "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") 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. // Report interfaces in the device in net.Interface format.
func (a *App) getInterfaces() ([]interfaces.Interface, error) { func (a *App) getInterfaces() ([]netmon.Interface, error) {
var ifaces []interfaces.Interface var ifaces []netmon.Interface
ifaceString, err := a.appCtx.GetInterfacesAsString() ifaceString, err := a.appCtx.GetInterfacesAsString()
if err != nil { if err != nil {
@ -68,7 +68,7 @@ func (a *App) getInterfaces() ([]interfaces.Interface, error) {
continue continue
} }
newIf := interfaces.Interface{ newIf := netmon.Interface{
Interface: &net.Interface{ Interface: &net.Interface{
Name: name, Name: name,
Index: index, Index: index,
@ -242,7 +242,7 @@ func (b *backend) NetworkChanged(ifname string) {
}() }()
// Set the interface name and alert the monitor. // Set the interface name and alert the monitor.
interfaces.UpdateLastKnownDefaultRouteInterface(ifname) netmon.UpdateLastKnownDefaultRouteInterface(ifname)
if b.sys != nil { if b.sys != nil {
if nm, ok := b.sys.NetMon.GetOK(); ok { if nm, ok := b.sys.NetMon.GetOK(); ok {
nm.InjectEvent() nm.InjectEvent()

@ -15,7 +15,7 @@ import (
"tailscale.com/logpolicy" "tailscale.com/logpolicy"
"tailscale.com/logtail" "tailscale.com/logtail"
"tailscale.com/logtail/filch" "tailscale.com/logtail/filch"
"tailscale.com/net/interfaces" "tailscale.com/net/netmon"
"tailscale.com/types/logger" "tailscale.com/types/logger"
"tailscale.com/types/logid" "tailscale.com/types/logid"
"tailscale.com/util/clientmetric" "tailscale.com/util/clientmetric"
@ -39,7 +39,7 @@ func newApp(dataDir, directFileRoot string, appCtx AppContext) Application {
a.ready.Add(1) a.ready.Add(1)
a.store = newStateStore(a.appCtx) a.store = newStateStore(a.appCtx)
interfaces.RegisterInterfaceGetter(a.getInterfaces) netmon.RegisterInterfaceGetter(a.getInterfaces)
syspolicy.RegisterHandler(syspolicyHandler{a: a}) syspolicy.RegisterHandler(syspolicyHandler{a: a})
go func() { go func() {
defer func() { defer func() {

Loading…
Cancel
Save