[SCTP] Fix bug in setting ephemeral port in the bind address.
Linux Kernel Mailing List <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1530.1.17, 2004/12/28 17:08:19-08:00, [email protected] [SCTP] Fix bug in setting ephemeral port in the bind address. Signed-off-by: Sridhar Samudrala <[email protected]> socket.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c 2005-01-15 07:05:43 -08:00 +++ b/net/sctp/socket.c 2005-01-15 07:05:43 -08:00 @@ -338,8 +338,8 @@ } /* Refresh ephemeral port. */ - if (!snum) - snum = sk->num; + if (!bp->port) + bp->port = sk->num; /* Add the address to the bind address list. */ sctp_local_bh_disable(); @@ -349,8 +349,6 @@ addr->v4.sin_port = ntohs(addr->v4.sin_port); ret = sctp_add_bind_addr(bp, addr, GFP_ATOMIC); addr->v4.sin_port = htons(addr->v4.sin_port); - if (!ret && !bp->port) - bp->port = snum; sctp_write_unlock(&ep->base.addr_lock); sctp_local_bh_enable();