From 16c4fc58bd4c5f1106c69ae566c2731bdbb3ab85 Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Fri, 10 May 2024 09:56:19 -0700 Subject: [PATCH] wgengine/magicsock: enable batching ops for android Signed-off-by: Jordan Whited --- wgengine/magicsock/magicsock.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 8505aff44..046528a69 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -2177,7 +2177,7 @@ var _ conn.Bind = (*connBind)(nil) func (c *connBind) BatchSize() int { // TODO(raggi): determine by properties rather than hardcoding platform behavior switch runtime.GOOS { - case "linux": + case "linux", "android": return conn.IdealBatchSize default: return 1 @@ -2682,7 +2682,7 @@ func tryUpgradeToBatchingUDPConn(pconn nettype.PacketConn, network string, batch if network != "udp4" && network != "udp6" { return pconn } - if runtime.GOOS != "linux" { + if runtime.GOOS != "linux" && runtime.GOOS != "android" { return pconn } if strings.HasPrefix(hostinfo.GetOSVersion(), "2.") {