dccp: fix bug in updating the GSR
authorSamuel Jero <sj323707@ohio.edu>
Thu, 30 Dec 2010 11:15:41 +0000 (12:15 +0100)
committerGerrit Renker <gerrit@erg.abdn.ac.uk>
Fri, 7 Jan 2011 11:22:43 +0000 (12:22 +0100)
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 <sj323707@ohio.edu>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
net/dccp/dccp.h

index 45087052d8948b3fcdb8808e990217b227c5aba9..5fdb072290178a2a7b1d4b9b64fb80cbe02a465e 100644 (file)
@@ -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);
        /*