]> git.karo-electronics.de Git - linux-beck.git/commit
[CCID2]: Sequence number wraparound issues
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Thu, 4 Oct 2007 21:43:09 +0000 (14:43 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:54:35 +0000 (16:54 -0700)
commit5e28599a6e45eb8ce7e50510b06c3a34ebf1a8fa
treeff6a34c677f1c16a5fd0921f75fbe58a1568ca6e
parent6c583248083c30c5305ec561e79f666ca465b376
[CCID2]: Sequence number wraparound issues

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: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/ccids/ccid2.c