Skip to content

Commit 763dadd

Browse files
samueljeroGerrit Renker
authored andcommitted
dccp: fix bug in updating the GSR
Currently dccp_check_seqno allows any valid packet to update the Greatest Sequence Number Received, even if that packet's sequence number is less than the current GSR. This patch adds a check to make sure that the new packet's sequence number is greater than GSR. Signed-off-by: Samuel Jero <[email protected]> Signed-off-by: Gerrit Renker <[email protected]>
1 parent 2cf5be9 commit 763dadd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/dccp/dccp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ static inline void dccp_update_gsr(struct sock *sk, u64 seq)
426426
{
427427
struct dccp_sock *dp = dccp_sk(sk);
428428

429-
dp->dccps_gsr = seq;
429+
if (after48(seq, dp->dccps_gsr))
430+
dp->dccps_gsr = seq;
430431
/* Sequence validity window depends on remote Sequence Window (7.5.1) */
431432
dp->dccps_swl = SUB48(ADD48(dp->dccps_gsr, 1), dp->dccps_r_seq_win / 4);
432433
/*

0 commit comments

Comments
 (0)