]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sctp/output.c
sctp: Fix mis-ordering of user space data when multihoming in use
[net-next-2.6.git] / net / sctp / output.c
index b210d2077e288216a6a4a427d6daed2e9a20eef5..7c5589363433c38d6c63a344f36d5e9d61befc45 100644 (file)
@@ -429,23 +429,22 @@ int sctp_packet_transmit(struct sctp_packet *packet)
                list_del_init(&chunk->list);
                if (sctp_chunk_is_data(chunk)) {
 
-                       if (!chunk->has_tsn) {
-                               sctp_chunk_assign_ssn(chunk);
-                               sctp_chunk_assign_tsn(chunk);
-
-                       /* 6.3.1 C4) When data is in flight and when allowed
-                        * by rule C5, a new RTT measurement MUST be made each
-                        * round trip.  Furthermore, new RTT measurements
-                        * SHOULD be made no more than once per round-trip
-                        * for a given destination transport address.
-                        */
+                       if (!chunk->resent) {
+
+                               /* 6.3.1 C4) When data is in flight and when allowed
+                                * by rule C5, a new RTT measurement MUST be made each
+                                * round trip.  Furthermore, new RTT measurements
+                                * SHOULD be made no more than once per round-trip
+                                * for a given destination transport address.
+                                */
 
                                if (!tp->rto_pending) {
                                        chunk->rtt_in_progress = 1;
                                        tp->rto_pending = 1;
                                }
-                       } else
-                               chunk->resent = 1;
+                       }
+
+                       chunk->resent = 1;
 
                        has_data = 1;
                }
@@ -722,6 +721,8 @@ static void sctp_packet_append_data(struct sctp_packet *packet,
        /* Has been accepted for transmission. */
        if (!asoc->peer.prsctp_capable)
                chunk->msg->can_abandon = 0;
+       sctp_chunk_assign_tsn(chunk);
+       sctp_chunk_assign_ssn(chunk);
 }
 
 static sctp_xmit_t sctp_packet_will_fit(struct sctp_packet *packet,