diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-08-21 07:24:30 +0200 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-08-30 19:55:20 +0200 |
commit | 2772b495efe341a02c867bc3a03d7362bd336832 (patch) | |
tree | 7ca42b0e414fffd340bb2242cc1f61547cf21183 /net/sctp/socket.c | |
parent | SCTP: Use net_ratelimit to suppress error messages print too fast (diff) | |
download | linux-2772b495efe341a02c867bc3a03d7362bd336832.tar.xz linux-2772b495efe341a02c867bc3a03d7362bd336832.zip |
SCTP: Pick the correct port when binding to 0.
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>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 01c6364245b7..de7921226725 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -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. */ |