diff options
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 1c3e9a67ba..24594c5e4d 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -1154,8 +1154,12 @@ function convertFromOpenVpnConstraints( function convertFromWireguardConstraints( constraints: grpcTypes.WireguardConstraints, ): IWireguardConstraints { - const port = convertFromConstraint(constraints.getPort()); - return { port }; + const transportPort = convertFromConstraint(constraints.getPort()); + if (transportPort !== 'any' && 'only' in transportPort) { + const port = convertFromConstraint(transportPort.only.getPort()); + return { port }; + } + return { port: 'any' }; } function convertFromTunnelTypeConstraint( @@ -1260,7 +1264,10 @@ function convertToWireguardConstraints( const wireguardConstraints = new grpcTypes.WireguardConstraints(); const port = liftConstraint(constraint.port); if (port) { - wireguardConstraints.setPort(port); + const portConstraints = new grpcTypes.TransportPort(); + portConstraints.setPort(port); + portConstraints.setProtocol(grpcTypes.TransportProtocol.UDP); + wireguardConstraints.setPort(portConstraints); } return wireguardConstraints; } |
