make port range inclusive

pull/4398/head
Matthew Hooker 9 years ago
parent c1f5545986
commit 36b436b2b7
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1

@ -45,7 +45,8 @@ func (s *StepHTTPServer) Run(state multistep.StateBag) multistep.StepAction {
if portRange > 0 {
// Intn will panic if portRange == 0, so we do a check.
offset = uint(rand.Intn(portRange))
// Intn is from [0, n), so add 1 to make from [0, n]
offset = uint(rand.Intn(portRange + 1))
}
httpPort = offset + s.HTTPPortMin

Loading…
Cancel
Save