Bluetooth: Use the proper error value from bt_skb_send_alloc()
[pandora-kernel.git] / net / sctp / output.c
index fad261d..60600d3 100644 (file)
@@ -41,6 +41,8 @@
  * be incorporated into the next SCTP release.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/wait.h>
@@ -92,7 +94,6 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet,
        SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __func__,
                          packet, vtag);
 
-       sctp_packet_reset(packet);
        packet->vtag = vtag;
 
        if (ecn_capable && sctp_packet_empty(packet)) {
@@ -429,24 +430,17 @@ int sctp_packet_transmit(struct sctp_packet *packet)
        list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
                list_del_init(&chunk->list);
                if (sctp_chunk_is_data(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;
-                               }
+                       if (!tp->rto_pending) {
+                               chunk->rtt_in_progress = 1;
+                               tp->rto_pending = 1;
                        }
-
-                       chunk->resent = 1;
-
                        has_data = 1;
                }
 
@@ -681,7 +675,7 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet,
                 * Don't delay large message writes that may have been
                 * fragmeneted into small peices.
                 */
-               if ((len < max) && (chunk->msg->msg_size < max)) {
+               if ((len < max) && chunk->msg->can_delay) {
                        retval = SCTP_XMIT_NAGLE_DELAY;
                        goto finish;
                }