• Gerrit Renker's avatar
    [CCID2]: Sequence number wraparound issues · 5e28599a
    Gerrit Renker authored
    This replaces several uses of standard arithmetic with the DCCP
    sequence number arithmetic functions. The problem here is that the
    sequence number wrap-around was not taken into consideration.
    
     * Condition "seqp->ccid2s_seq <= prev->ccid2s_seq" has been replaced
       by
    
       	dccp_delta_seqno(seqp->ccid2s_seq, prev->ccid2s_seq) >= 0
    
       since if seqp is `before' prev, then the delta_seqno() is positive.
    
     * The test whether sequence numbers `a' and `b' are consecutive has
       the form
    
       	dccp_delta_seqno(a, b) == 1
    
     * Increment of ccid2hctx_rpseq could be done using dccp_inc_seqno(),
       but since here the incremented ccid2hctx_rpseq == seqno, used
       assignment instead.
    Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5e28599a
ccid2.c 21.4 KB