From d9fceaf39d315fc81572da883dbee56591325eef Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 18 Jun 2015 10:19:46 +0200 Subject: [PATCH] update CHANGELOG --- CHANGELOG.md | 2 ++ builder/virtualbox/common/step_forward_ssh.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e100ad128..985c4d4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,6 +118,7 @@ BUG FIXES: to retrieve the SSH IP from. [GH-2220] * builder/qemu: Add `disk_discard` option [GH-2120] * builder/qemu: Use proper SSH port, not hardcoded to 22. [GH-2236] + * builder/qemu: Find unused SSH port if SSH port is taken. [GH-2032] * builder/virtualbox: Bind HTTP server to IPv4, which is more compatible with OS installers. [GH-1709] * builder/virtualbox: Remove the floppy controller in addition to the @@ -126,6 +127,7 @@ BUG FIXES: ".iso" extension didn't work. [GH-1839] * builder/virtualbox: Output dir is verified at runtime, not template validation time. [GH-2233] + * builder/virtualbox: Find unused SSH port if SSH port is taken. [GH-2032] * builder/vmware: Add 100ms delay between keystrokes to avoid subtle timing issues in most cases. [GH-1663] * builder/vmware: Bind HTTP server to IPv4, which is more compatible with diff --git a/builder/virtualbox/common/step_forward_ssh.go b/builder/virtualbox/common/step_forward_ssh.go index a33efc977..86376c834 100644 --- a/builder/virtualbox/common/step_forward_ssh.go +++ b/builder/virtualbox/common/step_forward_ssh.go @@ -46,10 +46,10 @@ func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction { } for { - sshHostPort = offset + s.HostPortMin - if sshHostPort >= s.HostPortMax { + sshHostPort = offset + int(s.HostPortMin) + if sshHostPort >= int(s.HostPortMax) { offset = 0 - sshHostPort = s.HostPortMin + sshHostPort = int(s.HostPortMin) } log.Printf("Trying port: %d", sshHostPort) l, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", sshHostPort))