tailscale/tailscale · error

could not set TCP RX buf size: %v

Error message

could not set TCP RX buf size: %v

What it means

setTCPBufSizes: gVisor netstack rejected the TCPReceiveBufferSizeRangeOption transport option while tuning RX buffer sizes. An internal netstack configuration failure at subsystem creation; the wrapped tcpip error explains why.

Source

Thrown at wgengine/netstack/netstack.go:316

	// features are not (yet) implemented, and socket buffer memory is not
	// controlled within gVisor, e.g. we allocate *stack.PacketBuffer's for the
	// write path within Tailscale. Therefore, we loosen our understanding of
	// the relationship between these Linux and gVisor tunables. The chosen
	// values are biased towards higher throughput on high bandwidth-delay
	// product paths, except on memory-constrained platforms.
	tcpRXBufOpt := tcpip.TCPReceiveBufferSizeRangeOption{
		// Min is unused by gVisor at the time of writing, but partially plumbed
		// for application by the TCP_WINDOW_CLAMP socket option.
		Min: tcpRXBufMinSize,
		// Default is used by gVisor at socket creation.
		Default: tcpRXBufDefSize,
		// Max is used by gVisor to cap the advertised receive window post-read.
		// (tcp_moderate_rcvbuf=true, the default).
		Max: tcpRXBufMaxSize,
	}
	tcpipErr := ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &tcpRXBufOpt)
	if tcpipErr != nil {
		return fmt.Errorf("could not set TCP RX buf size: %v", tcpipErr)
	}
	tcpTXBufOpt := tcpip.TCPSendBufferSizeRangeOption{
		// Min in unused by gVisor at the time of writing.
		Min: tcpTXBufMinSize,
		// Default is used by gVisor at socket creation.
		Default: tcpTXBufDefSize,
		// Max is used by gVisor to cap the send window.
		Max: tcpTXBufMaxSize,
	}
	tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &tcpTXBufOpt)
	if tcpipErr != nil {
		return fmt.Errorf("could not set TCP TX buf size: %v", tcpipErr)
	}
	return nil
}

// Create creates and populates a new Impl.
func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magicsock.Conn, dialer *tsdial.Dialer, dns *dns.Manager, pm *proxymap.Mapper) (*Impl, error) {

View on GitHub (pinned to 5201273aec)

Solutions

  1. Reduce the requested TCP receive buffer size to a value the kernel permits (check /proc/sys/net/ipv4/tcp_rmem).
  2. Ensure tailscaled has CAP_NET_ADMIN or the privileges needed to tune socket buffers.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at wgengine/netstack/netstack.go:315 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tailscale/tailscale@5201273aec (2026-08-18). Data as JSON: /api/errors/238930b8af036c9e. Report an issue: GitHub.