docker/docker — pull request #8671 by shuai-z (2014-10-21 04:39:58+00:00)
Title: Port number 49153(BeginPortRange) would be returned twice, causing dupli...

...cation and potential errors.

If we first request port 49153 (BeginPortRange) explicitly, and later some time request the next free port (of same ip/proto) by calling RequestPort() with port number 0, we will again get 49153 returned, even if it's currently in use. Because findPort() blindly retured BeginPortRange the first run, without checking if it has already been taken.