: [DCCP] ACKVEC: fix ackvector length calculation
PATCH 1/10 : [DCCP] ACKVEC: fix ackvector length calculation
Fix ackvector length calculation upon receiving an "ack-of-ack". This patch avoids the ackvector from growing too large which causes it to not be inserted into packets.
Signed-off-by Andrea Bittau <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
------------------------------------------------------------------------------
ackvec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
------------------------------------------------------------------------------
net/dccp/ackvec.c +7 -5
@@ -353,11 +353,13 @@ static void dccp_ackvec_throw_record(str {struct dccp_ackvec_record *next; - av->dccpav_buf_tail = avr->dccpavr_ack_ptr -1 ; -if (av->dccpav_buf_tail =0 ) - av->dccpav_buf_tail =DCCP_MAX_ACKVEC_LEN -1 ; - - av->dccpav_vec_len -= avr->dccpavr_sent_len; +/* sort out vector length */ +if (av->dccpav_buf_head <= avr->dccpavr_ack_ptr) + av->dccpav_vec_len = avr->dccpavr_ack_ptr - av->dccpav_buf_head; +else + av->dccpav_vec_len =DCCP_MAX_ACKVEC_LEN -1 + - av->dccpav_buf_head + + avr->dccpavr_ack_ptr;/* free records */ list_for_each_entry_safe_from(avr, next, &av->dccpav_records,
From: Arnaldo Carvalho de Melo <[email protected]>
Date: Thu, 14 Sep 2006 14:08:25 -0300
Quoted 6 lines
Fix ackvector length calculation upon receiving an "ack-of-ack". This patch avoids the ackvector from growing too large which causes it to not be inserted into packets.
Signed-off-by Andrea Bittau <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
Applied.