Merge tag 'fbdev-fixes-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba...
[linux-drm-fsl-dcu.git] / net / sctp / output.c
index 319137340d158df36094c45b8eae1fc13df50825..0e2644d0a773710d149639ab3aa777c6313a7737 100644 (file)
@@ -390,7 +390,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
        __u8 has_data = 0;
        struct dst_entry *dst = tp->dst;
        unsigned char *auth = NULL;     /* pointer to auth in skb data */
-       __u32 cksum_buf_len = sizeof(struct sctphdr);
 
        pr_debug("%s: packet:%p\n", __func__, packet);
 
@@ -475,10 +474,11 @@ int sctp_packet_transmit(struct sctp_packet *packet)
                         * for a given destination transport address.
                         */
 
-                       if (!tp->rto_pending) {
+                       if (!chunk->resent && !tp->rto_pending) {
                                chunk->rtt_in_progress = 1;
                                tp->rto_pending = 1;
                        }
+
                        has_data = 1;
                }
 
@@ -493,7 +493,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
                if (chunk == packet->auth)
                        auth = skb_tail_pointer(nskb);
 
-               cksum_buf_len += chunk->skb->len;
                memcpy(skb_put(nskb, chunk->skb->len),
                               chunk->skb->data, chunk->skb->len);
 
@@ -538,12 +537,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
        if (!sctp_checksum_disable) {
                if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
                    (dst_xfrm(dst) != NULL) || packet->ipfragok) {
-                       __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
-
-                       /* 3) Put the resultant value into the checksum field in the
-                        *    common header, and leave the rest of the bits unchanged.
-                        */
-                       sh->checksum = sctp_end_cksum(crc32);
+                       sh->checksum = sctp_compute_cksum(nskb, 0);
                } else {
                        /* no need to seed pseudo checksum for SCTP */
                        nskb->ip_summed = CHECKSUM_PARTIAL;