summaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-06-01 12:41:15 -0400
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-06-03 09:14:47 -0400
commitc6ba68a26645dbc5029a9faa5687ebe6fcfc53e4 (patch)
treee47a8f343b7fd0ba0a5d3e49a740d5dbe73e430a /net/sctp/associola.c
parent9919b455fc00c995ef8141848bdc0709ce50bf36 (diff)
downloadlinux-stable-c6ba68a26645dbc5029a9faa5687ebe6fcfc53e4.tar.gz
linux-stable-c6ba68a26645dbc5029a9faa5687ebe6fcfc53e4.tar.bz2
linux-stable-c6ba68a26645dbc5029a9faa5687ebe6fcfc53e4.zip
sctp: support non-blocking version of the new sctp_connectx() API
Prior implementation of the new sctp_connectx() call that returns an association ID did not work correctly on non-blocking socket. This is because we could not return both a EINPROGRESS error and an association id. This is a new implementation that supports this. Originally from Ivan Skytte Jørgensen <isj-sctp@i1.dk Signed-off-by: Ivan Skytte Jørgensen <isj-sctp@i1.dk Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 39f5166ae7af..525864bf4f07 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1470,6 +1470,10 @@ int sctp_assoc_set_id(struct sctp_association *asoc, gfp_t gfp)
{
int assoc_id;
int error = 0;
+
+ /* If the id is already assigned, keep it. */
+ if (asoc->assoc_id)
+ return error;
retry:
if (unlikely(!idr_pre_get(&sctp_assocs_id, gfp)))
return -ENOMEM;