cmd/tailscale/cli,ipn,all: make peer relay server port a *uint16

In preparation for exposing its configuration via ipn.ConfigVAlpha,
change {Masked}Prefs.RelayServerPort from *int to *uint16. This takes a
defensive stance against invalid inputs at JSON decode time.

'tailscale set --relay-server-port' is currently the only input to this
pref, and has always sanitized input to fit within a uint16.

Updates tailscale/corp#34591

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-11-25 15:05:04 -08:00
committed by Jordan Whited
parent 53476ce872
commit 824027305a
9 changed files with 48 additions and 51 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ func TestPrefsEqual(t *testing.T) {
have, prefsHandles)
}
relayServerPort := func(port int) *int {
relayServerPort := func(port uint16) *uint16 {
return &port
}
nets := func(strs ...string) (ns []netip.Prefix) {