Fix --port

This commit is contained in:
Owen
2026-03-03 16:27:57 -08:00
parent 6c6ba45024
commit 7920295b8c
2 changed files with 13 additions and 9 deletions

View File

@@ -112,6 +112,8 @@ func NewWireGuardService(interfaceName string, port uint16, mtu int, host string
return nil, fmt.Errorf("failed to generate private key: %v", err)
}
logger.Debug("+++++++++++++++++++++++++++++++= the port is %d", port)
if port == 0 {
// Find an available port
portRandom, err := util.FindAvailableUDPPort(49152, 65535)