aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:57 -0500
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:57 -0500
commite0e9db178a5ba4dbb5f16f958f1affbdc63d2cc4 (patch)
tree22affd5fd2b2975de845a9626a89c40ad1c2df24 /net/sctp
parent6383cfb3ed3c5c0bea06da0099c219ef4237ecf5 (diff)
sctp: Select a working primary during sctp_connectx()
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 <dreibh@iem.uni-due.de> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c6
-rw-r--r--net/sctp/sm_sideeffect.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 7eed77a39d0d..8e755ebff3b8 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -512,7 +512,13 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
512 * to this destination address earlier. The sender MUST set 512 * to this destination address earlier. The sender MUST set
513 * CYCLING_CHANGEOVER to indicate that this switch is a 513 * CYCLING_CHANGEOVER to indicate that this switch is a
514 * double switch to the same destination address. 514 * double switch to the same destination address.
515 *
516 * Really, only bother is we have data queued or outstanding on
517 * the association.
515 */ 518 */
519 if (!asoc->outqueue.outstanding_bytes && !asoc->outqueue.out_qlen)
520 return;
521
516 if (transport->cacc.changeover_active) 522 if (transport->cacc.changeover_active)
517 transport->cacc.cycling_changeover = changeover; 523 transport->cacc.cycling_changeover = changeover;
518 524
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 8674d4919556..eda4fe783be5 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1418,6 +1418,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1418 asoc->init_last_sent_to = t; 1418 asoc->init_last_sent_to = t;
1419 chunk->transport = t; 1419 chunk->transport = t;
1420 t->init_sent_count++; 1420 t->init_sent_count++;
1421 /* Set the new transport as primary */
1422 sctp_assoc_set_primary(asoc, t);
1421 break; 1423 break;
1422 1424
1423 case SCTP_CMD_INIT_RESTART: 1425 case SCTP_CMD_INIT_RESTART: