wgengine/magicsock: don't upgrade to linuxBatchingConn on Android (#13161)

In a93dc6cdb1 tryUpgradeToBatchingConn()
moved to build tag gated files, but the runtime.GOOS condition excluding
Android was removed unintentionally from batching_conn_linux.go. Add it
back.

Updates tailscale/corp#22348

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited 2024-08-15 14:54:25 -07:00 committed by GitHub
parent cc136a58ea
commit ccf091e4a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"fmt"
"net"
"net/netip"
"runtime"
"strings"
"sync"
"sync/atomic"
@ -366,6 +367,10 @@ func setGSOSizeInControl(control *[]byte, gsoSize uint16) {
// tryUpgradeToBatchingConn probes the capabilities of the OS and pconn, and
// upgrades pconn to a *linuxBatchingConn if appropriate.
func tryUpgradeToBatchingConn(pconn nettype.PacketConn, network string, batchSize int) nettype.PacketConn {
if runtime.GOOS != "linux" {
// Exclude Android.
return pconn
}
if network != "udp4" && network != "udp6" {
return pconn
}