mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
Add --tcp-save-syn on Linux to record client MSS in a Prometheus histogram. Count retrieval outcomes separately and limit saved-SYN error logs to one per ten minutes across clients. IPv6 extension headers are unsupported. Estimate the network-namespace SYN rate from kernel counters once per second. Disable TCP_SAVE_SYN on listeners above 100,000/s or if rate measurement fails, leaving it off until restart. Updates tailscale/corp#49139 Signed-off-by: James Tucker <[email protected]>
19 lines
425 B
Go
19 lines
425 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !linux
|
|
|
|
package main
|
|
|
|
import (
|
|
"net"
|
|
"syscall"
|
|
|
|
"tailscale.com/derp/derpserver"
|
|
)
|
|
|
|
// controlTCPSaveSyn is a no-op on platforms without TCP_SAVE_SYN.
|
|
func controlTCPSaveSyn(network string, c syscall.RawConn) error { return nil }
|
|
|
|
func newTCPSaveSynListener(ln net.Listener, s *derpserver.Server) net.Listener { return ln }
|