Skip to content

Commit 985e146

Browse files
author
Sridhar Samudrala
committed
[SCTP] Fix to wakeup blocking connect() after max INIT retries failed.
1 parent 386f9ab commit 985e146

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

net/sctp/sm_sideeffect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
429429
sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
430430
SCTP_ULPEVENT(event));
431431

432+
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
433+
SCTP_STATE(SCTP_STATE_CLOSED));
434+
432435
/* SEND_FAILED sent later when cleaning up the association. */
433436
asoc->outqueue.error = error;
434437
sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());

net/sctp/socket.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4393,7 +4393,11 @@ static int sctp_wait_for_connect(struct sctp_association *asoc, long *timeo_p)
43934393
return err;
43944394

43954395
do_error:
4396-
err = -ECONNREFUSED;
4396+
if (asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1 >=
4397+
asoc->max_init_attempts)
4398+
err = -ETIMEDOUT;
4399+
else
4400+
err = -ECONNREFUSED;
43974401
goto out;
43984402

43994403
do_interrupted:

0 commit comments

Comments
 (0)