socket-util: Log kernel-chosen bound ports in inet_open_passive().
Usually, for passive sockets, one wishes to bind a particular well-known
port, so that clients can easily connect. But automated tests cannot
necessarily bind a well-known port, because that would cause multiple
concurrent tests to interfere with each other or with a real instance of
the service running on the system. They could bind to a randomly selected
port chosen by the user (the Open vSwitch automated tests currently do this)
but this leads to occasional "false negative" test failures when the port
selected happens to be in use.
The best alternative for automated tests is to let the kernel choose a
port that is not otherwise in use, which can be accomplished by specifying
port 0. But in that case there is no easy way for other software to know
what port the kernel chose. This commit fixes that problem one way by
logging the bound port when it is chosen by the kernel.
Signed-off-by: Ben Pfaff <blp@nicira.com>