Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 763dadd4 authored by Samuel Jero's avatar Samuel Jero Committed by Gerrit Renker
Browse files

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: default avatarSamuel Jero <sj323707@ohio.edu>
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
parent 2cf5be93
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -426,6 +426,7 @@ static inline void dccp_update_gsr(struct sock *sk, u64 seq)
{
{
	struct dccp_sock *dp = dccp_sk(sk);
	struct dccp_sock *dp = dccp_sk(sk);


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