mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-22 13:37:10 +00:00
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:
committed by
Jordan Whited
parent
53476ce872
commit
824027305a
@@ -249,7 +249,7 @@ func runSet(ctx context.Context, args []string) (retErr error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set relay server port: %v", err)
|
||||
}
|
||||
maskedPrefs.Prefs.RelayServerPort = ptr.To(int(uport))
|
||||
maskedPrefs.Prefs.RelayServerPort = ptr.To(uint16(uport))
|
||||
}
|
||||
|
||||
if setArgs.relayServerStaticEndpoints != "" {
|
||||
|
||||
Reference in New Issue
Block a user