• Tom Herbert's avatar
    inet: Don't go into port scan when looking for specific bind port · 9af7e923
    Tom Herbert authored
    inet_csk_get_port is called with port number (snum argument) that may be
    zero or nonzero. If it is zero, then the intent is to find an available
    ephemeral port number to bind to. If snum is non-zero then the caller
    is asking to allocate a specific port number. In the latter case we
    never want to perform the scan in ephemeral port range. It is
    conceivable that this can happen if the "goto again" in "tb_found:"
    is done. This patch adds a check that snum is zero before doing
    the "goto again".
    Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9af7e923
inet_connection_sock.c 26.7 KB