vmware-iso: Fix error vnc min/max ports [GH-1288]
This commit is contained in:
parent
1e5d746783
commit
6acbc91ff7
|
@ -34,7 +34,12 @@ func (stepConfigureVNC) VNCAddress(portMin, portMax uint) (string, uint) {
|
|||
var vncPort uint
|
||||
portRange := int(portMax - portMin)
|
||||
for {
|
||||
vncPort = uint(rand.Intn(portRange)) + portMin
|
||||
if portRange > 0 {
|
||||
vncPort = uint(rand.Intn(portRange)) + portMin
|
||||
} else {
|
||||
vncPort = portMin
|
||||
}
|
||||
|
||||
log.Printf("Trying port: %d", vncPort)
|
||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", vncPort))
|
||||
if err == nil {
|
||||
|
|
Loading…
Reference in New Issue