]> Pileus Git - ~andy/linux/commitdiff
sctp: remove the repeat initialize with 0
authorwangweidong <wangweidong1@huawei.com>
Sat, 26 Oct 2013 08:06:31 +0000 (16:06 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Oct 2013 05:02:34 +0000 (01:02 -0400)
kmem_cache_zalloc had set the allocated memory to zero. I think no need
to initialize with 0. And move the comments to the function begin.

Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sm_make_chunk.c

index d244a23ab8d33c95e0b8133e212c35bc4a47875a..fe690320b1e430a7915e35d36d26a72847368438 100644 (file)
@@ -1297,6 +1297,13 @@ struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc)
 
 /* Turn an skb into a chunk.
  * FIXME: Eventually move the structure directly inside the skb->cb[].
+ *
+ * sctpimpguide-05.txt Section 2.8.2
+ * M1) Each time a new DATA chunk is transmitted
+ * set the 'TSN.Missing.Report' count for that TSN to 0. The
+ * 'TSN.Missing.Report' count will be used to determine missing chunks
+ * and when to fast retransmit.
+ *
  */
 struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
                            const struct sctp_association *asoc,
@@ -1314,29 +1321,9 @@ struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
        INIT_LIST_HEAD(&retval->list);
        retval->skb             = skb;
        retval->asoc            = (struct sctp_association *)asoc;
-       retval->has_tsn         = 0;
-       retval->has_ssn         = 0;
-       retval->rtt_in_progress = 0;
-       retval->sent_at         = 0;
        retval->singleton       = 1;
-       retval->end_of_packet   = 0;
-       retval->ecn_ce_done     = 0;
-       retval->pdiscard        = 0;
-
-       /* sctpimpguide-05.txt Section 2.8.2
-        * M1) Each time a new DATA chunk is transmitted
-        * set the 'TSN.Missing.Report' count for that TSN to 0. The
-        * 'TSN.Missing.Report' count will be used to determine missing chunks
-        * and when to fast retransmit.
-        */
-       retval->tsn_missing_report = 0;
-       retval->tsn_gap_acked = 0;
-       retval->fast_retransmit = SCTP_CAN_FRTX;
 
-       /* If this is a fragmented message, track all fragments
-        * of the message (for SEND_FAILED).
-        */
-       retval->msg = NULL;
+       retval->fast_retransmit = SCTP_CAN_FRTX;
 
        /* Polish the bead hole.  */
        INIT_LIST_HEAD(&retval->transmitted_list);