Skip to content

Commit

Permalink
SCTP: Pick the correct port when binding to 0.
Browse files Browse the repository at this point in the history
sctp_bindx() allows the use of unspecified port.  The problem is
that every address we bind to ends up selecting a new port if
the user specified port 0.  This patch allows re-use of the
already selected port when the port from bindx was 0.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
  • Loading branch information
Vlad Yasevich committed Aug 30, 2007
1 parent d99fa42 commit 2772b49
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
* The function sctp_get_port_local() does duplicate address
* detection.
*/
addr->v4.sin_port = htons(snum);
if ((ret = sctp_get_port_local(sk, addr))) {
if (ret == (long) sk) {
/* This endpoint has a conflicting address. */
Expand Down

0 comments on commit 2772b49

Please sign in to comment.