Fix lookup of ephemeral port number