Skip to content

Commit 3dc0a54

Browse files
wangweidongdavem330
authored andcommitted
sctp: remove the repeat initialize with 0
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>
1 parent 2bccbad commit 3dc0a54

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

net/sctp/sm_make_chunk.c

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,13 @@ struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc)
12971297

12981298
/* Turn an skb into a chunk.
12991299
* FIXME: Eventually move the structure directly inside the skb->cb[].
1300+
*
1301+
* sctpimpguide-05.txt Section 2.8.2
1302+
* M1) Each time a new DATA chunk is transmitted
1303+
* set the 'TSN.Missing.Report' count for that TSN to 0. The
1304+
* 'TSN.Missing.Report' count will be used to determine missing chunks
1305+
* and when to fast retransmit.
1306+
*
13001307
*/
13011308
struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
13021309
const struct sctp_association *asoc,
@@ -1314,29 +1321,9 @@ struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
13141321
INIT_LIST_HEAD(&retval->list);
13151322
retval->skb = skb;
13161323
retval->asoc = (struct sctp_association *)asoc;
1317-
retval->has_tsn = 0;
1318-
retval->has_ssn = 0;
1319-
retval->rtt_in_progress = 0;
1320-
retval->sent_at = 0;
13211324
retval->singleton = 1;
1322-
retval->end_of_packet = 0;
1323-
retval->ecn_ce_done = 0;
1324-
retval->pdiscard = 0;
1325-
1326-
/* sctpimpguide-05.txt Section 2.8.2
1327-
* M1) Each time a new DATA chunk is transmitted
1328-
* set the 'TSN.Missing.Report' count for that TSN to 0. The
1329-
* 'TSN.Missing.Report' count will be used to determine missing chunks
1330-
* and when to fast retransmit.
1331-
*/
1332-
retval->tsn_missing_report = 0;
1333-
retval->tsn_gap_acked = 0;
1334-
retval->fast_retransmit = SCTP_CAN_FRTX;
13351325

1336-
/* If this is a fragmented message, track all fragments
1337-
* of the message (for SEND_FAILED).
1338-
*/
1339-
retval->msg = NULL;
1326+
retval->fast_retransmit = SCTP_CAN_FRTX;
13401327

13411328
/* Polish the bead hole. */
13421329
INIT_LIST_HEAD(&retval->transmitted_list);

0 commit comments

Comments
 (0)