Skip to content

Commit

Permalink
dccp: fix bug in updating the GSR
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
samueljero authored and Gerrit Renker committed Jan 7, 2011
1 parent 2cf5be9 commit 763dadd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ static inline void dccp_update_gsr(struct sock *sk, u64 seq)
{
struct dccp_sock *dp = dccp_sk(sk);

dp->dccps_gsr = seq;
if (after48(seq, dp->dccps_gsr))
dp->dccps_gsr = seq;
/* 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);
/*
Expand Down

0 comments on commit 763dadd

Please sign in to comment.