Skip to content

Commit

Permalink
sctp: Select a working primary during sctp_connectx()
Browse files Browse the repository at this point in the history
When sctp_connectx() is used, we pick the first address as
primary, even though it may not have worked.  This results
in excessive retransmits and poor performance.  We should
select the address that the association was established with.

Reported-by: Thomas Dreibholz <[email protected]>
Signed-off-by: Vlad Yasevich <[email protected]>
  • Loading branch information
Vlad Yasevich committed Nov 23, 2009
1 parent 6383cfb commit e0e9db1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,13 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
* to this destination address earlier. The sender MUST set
* CYCLING_CHANGEOVER to indicate that this switch is a
* double switch to the same destination address.
*
* Really, only bother is we have data queued or outstanding on
* the association.
*/
if (!asoc->outqueue.outstanding_bytes && !asoc->outqueue.out_qlen)
return;

if (transport->cacc.changeover_active)
transport->cacc.cycling_changeover = changeover;

Expand Down
2 changes: 2 additions & 0 deletions net/sctp/sm_sideeffect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
asoc->init_last_sent_to = t;
chunk->transport = t;
t->init_sent_count++;
/* Set the new transport as primary */
sctp_assoc_set_primary(asoc, t);
break;

case SCTP_CMD_INIT_RESTART:
Expand Down

0 comments on commit e0e9db1

Please sign in to comment.