]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sctp: Select a working primary during sctp_connectx()
authorVlad Yasevich <vladislav.yasevich@hp.com>
Mon, 23 Nov 2009 20:53:57 +0000 (15:53 -0500)
committerVlad Yasevich <vladislav.yasevich@hp.com>
Mon, 23 Nov 2009 20:53:57 +0000 (15:53 -0500)
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>
net/sctp/associola.c
net/sctp/sm_sideeffect.c

index 7eed77a39d0d149a518666ab509604f2c0ac9d4f..8e755ebff3b836f060296132cb2a6b850cab403d 100644 (file)
@@ -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;
 
index 8674d49195561fc7ed33a5b086eb4014d80f46a7..eda4fe783be5a9d04f5531ce3de0421e75aad3bd 100644 (file)
@@ -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: