@@ -93,7 +93,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
9393 */
9494 if (dh -> dccph_type == DCCP_PKT_SYNC ||
9595 dh -> dccph_type == DCCP_PKT_SYNCACK ) {
96- if (between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq , dp -> dccps_awl , dp -> dccps_awh ) &&
96+ if (between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq ,
97+ dp -> dccps_awl , dp -> dccps_awh ) &&
9798 !before48 (DCCP_SKB_CB (skb )-> dccpd_seq , dp -> dccps_swl ))
9899 dccp_update_gsr (sk , DCCP_SKB_CB (skb )-> dccpd_seq );
99100 else
@@ -122,11 +123,13 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
122123
123124 if (between48 (DCCP_SKB_CB (skb )-> dccpd_seq , lswl , dp -> dccps_swh ) &&
124125 (DCCP_SKB_CB (skb )-> dccpd_ack_seq == DCCP_PKT_WITHOUT_ACK_SEQ ||
125- between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq , lawl , dp -> dccps_awh ))) {
126+ between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq ,
127+ lawl , dp -> dccps_awh ))) {
126128 dccp_update_gsr (sk , DCCP_SKB_CB (skb )-> dccpd_seq );
127129
128130 if (dh -> dccph_type != DCCP_PKT_SYNC &&
129- DCCP_SKB_CB (skb )-> dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ )
131+ (DCCP_SKB_CB (skb )-> dccpd_ack_seq !=
132+ DCCP_PKT_WITHOUT_ACK_SEQ ))
130133 dp -> dccps_gar = DCCP_SKB_CB (skb )-> dccpd_ack_seq ;
131134 } else {
132135 dccp_pr_debug ("Step 6 failed, sending SYNC...\n" );
@@ -161,10 +164,13 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
161164 if (dccp_ackpkts_add (dp -> dccps_hc_rx_ackpkts ,
162165 DCCP_SKB_CB (skb )-> dccpd_seq ,
163166 DCCP_ACKPKTS_STATE_RECEIVED )) {
164- LIMIT_NETDEBUG (KERN_INFO "DCCP: acknowledgeable packets buffer full!\n" );
167+ LIMIT_NETDEBUG (KERN_INFO "DCCP: acknowledgeable "
168+ "packets buffer full!\n" );
165169 ap -> dccpap_ack_seqno = DCCP_MAX_SEQNO + 1 ;
166170 inet_csk_schedule_ack (sk );
167- inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK , TCP_DELACK_MIN , TCP_RTO_MAX );
171+ inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK ,
172+ TCP_DELACK_MIN ,
173+ DCCP_RTO_MAX );
168174 goto discard ;
169175 }
170176
@@ -175,7 +181,8 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
175181 */
176182 if (!inet_csk_ack_scheduled (sk )) {
177183 inet_csk_schedule_ack (sk );
178- inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK , 5 * HZ , TCP_RTO_MAX );
184+ inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK , 5 * HZ ,
185+ DCCP_RTO_MAX );
179186 }
180187 }
181188
@@ -186,8 +193,8 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
186193 case DCCP_PKT_DATAACK :
187194 case DCCP_PKT_DATA :
188195 /*
189- * FIXME: check if sk_receive_queue is full, schedule DATA_DROPPED option
190- * if it is.
196+ * FIXME: check if sk_receive_queue is full, schedule DATA_DROPPED
197+ * option if it is.
191198 */
192199 __skb_pull (skb , dh -> dccph_doff * 4 );
193200 __skb_queue_tail (& sk -> sk_receive_queue , skb );
@@ -272,11 +279,13 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
272279 __kfree_skb (sk -> sk_send_head );
273280 sk -> sk_send_head = NULL ;
274281
275- if (!between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq , dp -> dccps_awl , dp -> dccps_awh )) {
276- dccp_pr_debug ("invalid ackno: S.AWL=%llu, P.ackno=%llu, S.AWH=%llu \n" ,
277- (unsigned long long ) dp -> dccps_awl ,
278- (unsigned long long ) DCCP_SKB_CB (skb )-> dccpd_ack_seq ,
279- (unsigned long long ) dp -> dccps_awh );
282+ if (!between48 (DCCP_SKB_CB (skb )-> dccpd_ack_seq ,
283+ dp -> dccps_awl , dp -> dccps_awh )) {
284+ dccp_pr_debug ("invalid ackno: S.AWL=%llu, "
285+ "P.ackno=%llu, S.AWH=%llu \n" ,
286+ (unsigned long long )dp -> dccps_awl ,
287+ (unsigned long long )DCCP_SKB_CB (skb )-> dccpd_ack_seq ,
288+ (unsigned long long )dp -> dccps_awh );
280289 goto out_invalid_packet ;
281290 }
282291
@@ -296,16 +305,17 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
296305 /*
297306 * Step 10: Process REQUEST state (second part)
298307 * If S.state == REQUEST,
299- * / * If we get here, P is a valid Response from the server (see
300- * Step 4), and we should move to PARTOPEN state. PARTOPEN
301- * means send an Ack, don't send Data packets, retransmit
302- * Acks periodically, and always include any Init Cookie from
303- * the Response * /
308+ * / * If we get here, P is a valid Response from the
309+ * server (see Step 4), and we should move to
310+ * PARTOPEN state. PARTOPEN means send an Ack,
311+ * don't send Data packets, retransmit Acks
312+ * periodically, and always include any Init Cookie
313+ * from the Response * /
304314 * S.state := PARTOPEN
305315 * Set PARTOPEN timer
306316 * Continue with S.state == PARTOPEN
307- * / * Step 12 will send the Ack completing the three-way
308- * handshake * /
317+ * / * Step 12 will send the Ack completing the
318+ * three-way handshake * /
309319 */
310320 dccp_set_state (sk , DCCP_PARTOPEN );
311321
@@ -341,7 +351,8 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
341351
342352out_invalid_packet :
343353 return 1 ; /* dccp_v4_do_rcv will send a reset, but...
344- FIXME: the reset code should be DCCP_RESET_CODE_PACKET_ERROR */
354+ FIXME: the reset code should be
355+ DCCP_RESET_CODE_PACKET_ERROR */
345356}
346357
347358static int dccp_rcv_respond_partopen_state_process (struct sock * sk ,
@@ -358,11 +369,12 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk,
358369 case DCCP_PKT_DATAACK :
359370 case DCCP_PKT_ACK :
360371 /*
361- * FIXME: we should be reseting the PARTOPEN (DELACK) timer here,
362- * but only if we haven't used the DELACK timer for something else,
363- * like sending a delayed ack for a TIMESTAMP echo, etc, for now
364- * were not clearing it, sending an extra ACK when there is nothing
365- * else to do in DELACK is not a big deal after all.
372+ * FIXME: we should be reseting the PARTOPEN (DELACK) timer
373+ * here but only if we haven't used the DELACK timer for
374+ * something else, like sending a delayed ack for a TIMESTAMP
375+ * echo, etc, for now were not clearing it, sending an extra
376+ * ACK when there is nothing else to do in DELACK is not a big
377+ * deal after all.
366378 */
367379
368380 /* Stop the PARTOPEN timer */
@@ -374,7 +386,8 @@ static int dccp_rcv_respond_partopen_state_process(struct sock *sk,
374386
375387 if (dh -> dccph_type == DCCP_PKT_DATAACK ) {
376388 dccp_rcv_established (sk , skb , dh , len );
377- queued = 1 ; /* packet was queued (by dccp_rcv_established) */
389+ queued = 1 ; /* packet was queued
390+ (by dccp_rcv_established) */
378391 }
379392 break ;
380393 }
@@ -399,7 +412,8 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
399412 if (dccp_parse_options (sk , skb ))
400413 goto discard ;
401414
402- if (DCCP_SKB_CB (skb )-> dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ )
415+ if (DCCP_SKB_CB (skb )-> dccpd_ack_seq !=
416+ DCCP_PKT_WITHOUT_ACK_SEQ )
403417 dccp_event_ack_recv (sk , skb );
404418
405419 ccid_hc_rx_packet_recv (dp -> dccps_hc_rx_ccid , sk , skb );
@@ -415,14 +429,17 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
415429 DCCP_ACKPKTS_STATE_RECEIVED ))
416430 goto discard ;
417431 /*
418- * FIXME: this activation is probably wrong, have to study more
419- * TCP delack machinery and how it fits into DCCP draft, but
420- * for now it kinda "works" 8)
432+ * FIXME: this activation is probably wrong, have to
433+ * study more TCP delack machinery and how it fits into
434+ * DCCP draft, but for now it kinda "works" 8)
421435 */
422- if (dp -> dccps_hc_rx_ackpkts -> dccpap_ack_seqno == DCCP_MAX_SEQNO + 1 &&
436+ if ((dp -> dccps_hc_rx_ackpkts -> dccpap_ack_seqno ==
437+ DCCP_MAX_SEQNO + 1 ) &&
423438 !inet_csk_ack_scheduled (sk )) {
424439 inet_csk_schedule_ack (sk );
425- inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK , TCP_DELACK_MIN , TCP_RTO_MAX );
440+ inet_csk_reset_xmit_timer (sk , ICSK_TIME_DACK ,
441+ TCP_DELACK_MIN ,
442+ DCCP_RTO_MAX );
426443 }
427444 }
428445 }
@@ -436,7 +453,10 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
436453 * Drop packet and return
437454 */
438455 if (dh -> dccph_type == DCCP_PKT_RESET ) {
439- /* Queue the equivalent of TCP fin so that dccp_recvmsg exits the loop */
456+ /*
457+ * Queue the equivalent of TCP fin so that dccp_recvmsg
458+ * exits the loop
459+ */
440460 dccp_fin (sk , skb );
441461 dccp_time_wait (sk , DCCP_TIME_WAIT , 0 );
442462 return 0 ;
@@ -450,10 +470,12 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
450470 * Drop packet and return
451471 */
452472 } else if ((dp -> dccps_role != DCCP_ROLE_CLIENT &&
453- (dh -> dccph_type == DCCP_PKT_RESPONSE || dh -> dccph_type == DCCP_PKT_CLOSEREQ )) ||
473+ (dh -> dccph_type == DCCP_PKT_RESPONSE ||
474+ dh -> dccph_type == DCCP_PKT_CLOSEREQ )) ||
454475 (dp -> dccps_role == DCCP_ROLE_CLIENT &&
455476 dh -> dccph_type == DCCP_PKT_REQUEST ) ||
456- (sk -> sk_state == DCCP_RESPOND && dh -> dccph_type == DCCP_PKT_DATA )) {
477+ (sk -> sk_state == DCCP_RESPOND &&
478+ dh -> dccph_type == DCCP_PKT_DATA )) {
457479 dccp_send_sync (sk , DCCP_SKB_CB (skb )-> dccpd_seq );
458480 goto discard ;
459481 }
@@ -491,11 +513,13 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
491513
492514 case DCCP_RESPOND :
493515 case DCCP_PARTOPEN :
494- queued = dccp_rcv_respond_partopen_state_process (sk , skb , dh , len );
516+ queued = dccp_rcv_respond_partopen_state_process (sk , skb ,
517+ dh , len );
495518 break ;
496519 }
497520
498- if (dh -> dccph_type == DCCP_PKT_ACK || dh -> dccph_type == DCCP_PKT_DATAACK ) {
521+ if (dh -> dccph_type == DCCP_PKT_ACK ||
522+ dh -> dccph_type == DCCP_PKT_DATAACK ) {
499523 switch (old_state ) {
500524 case DCCP_PARTOPEN :
501525 sk -> sk_state_change (sk );
0 commit comments