mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-28 16:04:18 +07:00
[CCID2]: Fix sequence number arithmetic/comparisons
This replaces use of normal subtraction with modulo-48 subtraction. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3de5489f47
commit
cfbbeabc88
@ -24,9 +24,6 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This implementation should follow RFC 4341
|
* This implementation should follow RFC 4341
|
||||||
*
|
|
||||||
* BUGS:
|
|
||||||
* - sequence number wrapping
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../ccid.h"
|
#include "../ccid.h"
|
||||||
@ -619,9 +616,8 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
|||||||
/* go through this ack vector */
|
/* go through this ack vector */
|
||||||
while (veclen--) {
|
while (veclen--) {
|
||||||
const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
|
const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
|
||||||
u64 ackno_end_rl;
|
u64 ackno_end_rl = SUB48(ackno, rl);
|
||||||
|
|
||||||
dccp_set_seqno(&ackno_end_rl, ackno - rl);
|
|
||||||
ccid2_pr_debug("ackvec start:%llu end:%llu\n",
|
ccid2_pr_debug("ackvec start:%llu end:%llu\n",
|
||||||
(unsigned long long)ackno,
|
(unsigned long long)ackno,
|
||||||
(unsigned long long)ackno_end_rl);
|
(unsigned long long)ackno_end_rl);
|
||||||
@ -671,8 +667,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
|||||||
if (done)
|
if (done)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
ackno = SUB48(ackno_end_rl, 1);
|
||||||
dccp_set_seqno(&ackno, ackno_end_rl - 1);
|
|
||||||
vector++;
|
vector++;
|
||||||
}
|
}
|
||||||
if (done)
|
if (done)
|
||||||
|
Loading…
Reference in New Issue
Block a user