Skip to contentSkip to conversation

: [DCCP] ackvec: Fix how DCCP_ACKVEC_STATE_NOT_RECEIVED is used

PATCH Applied Arnaldo Carvalho de Melo 1 participant 1 message Sep 14, 2006 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 2/10 : [DCCP] ackvec: Fix how DCCP_ACKVEC_STATE_NOT_RECEIVED is used

Fix the way state is masked out. DCCP_ACKVEC_STATE_NOT_RECEIVED is defined as appears in the packet, therefore bit shifting is not required. This fix allows CCID2 to correctly detect losses.

------------------------------------------------------------------------------

 ackvec.c      |    3 +--
 ccids/ccid2.c |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

------------------------------------------------------------------------------

net/dccp/ackvec.c +1 -2
index 8dab723..bc5ff12 100644
@@ -436,8 +436,7 @@ static void dccp_ackvec_check_rcv_ackvec
 		break;
 found:
 		if (between48(avr->dccpavr_ack_seqno, ackno_end_rl, ackno)) {
-			const u8 state = (*vector &
-					  DCCP_ACKVEC_STATE_MASK) >> 6;
+			const u8 state = *vector & DCCP_ACKVEC_STATE_MASK;
 			if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED) {
 #ifdef CONFIG_IP_DCCP_DEBUG
 				struct dccp_sock *dp = dccp_sk(sk);
net/dccp/ccids/ccid2.c +2 -2
index e961562..b1d90c0 100644
@@ -582,8 +582,8 @@ static void ccid2_hc_tx_packet_recv(stru
 			 * run length
 			 */
 			while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) {
-				const u8 state = (*vector &
-						  DCCP_ACKVEC_STATE_MASK) >> 6;
+				const u8 state = *vector &
+						 DCCP_ACKVEC_STATE_MASK;
 
 				/* new packet received or marked */
 				if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED &&