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>
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user