Skip to content

Commit 1666534

Browse files
committed
backend: export SetPort via gomobile
1 parent 8fb4401 commit 1666534

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

intra/backend/ipn_proxies.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ func (o *RpnOps) SetPermaCreds(v bool) { o.permaCreds = v; o.rotateCreds = false
115115
func (o *RpnOps) SetForceFetchServers(v bool) { o.forceFetchServers = v }
116116

117117
// SetPort pins a specific WireGuard port; 0 means random (default).
118-
func (o *RpnOps) SetPort(port uint16) { o.newPort = port }
118+
func (o *RpnOps) SetPort(port int32) {
119+
if port >= 0 && port <= 65535 {
120+
o.newPort = uint16(port)
121+
}
122+
}
119123

120124
// Rotate reports whether a new WG keypair should be generated.
121125
func (o RpnOps) Rotate() bool { return o.rotateCreds }

0 commit comments

Comments
 (0)