]> git.baikalelectronics.ru Git - kernel.git/commit
[DCCP]: Do not process a packet twice when it's not in state DCCP_OPEN.
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>
Tue, 3 Jan 2006 22:25:17 +0000 (14:25 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Jan 2006 22:25:17 +0000 (14:25 -0800)
commite673adf9395f1b271079665a0d7fb8068efe9f50
tree8e6929b88040fb9acb92c3bfe1c45f210ad8e659
parenta46ed5f1a11861475146747036cf4c34bef6dba4
[DCCP]: Do not process a packet twice when it's not in state DCCP_OPEN.

When packets are received, the connection is either in DCCP_OPEN
[fast-path] or it isn't.  If it's not [e.g. DCCP_PARTOPEN] upper
layers will perform sanity checks and parse options.  If it is in
DCCP_OPEN, dccp_rcv_established() will do it.  It is important not to
re-parse options in dccp_rcv_established() when it is not called from
the fast-path.  Else, fore example, the ack vector will be added twice
and the CCID will see the packet twice.

The solution is to always enfore sanity checks from the upper layers.
When packets arrive in the fast-path, sanity checks will be performed
before calling dccp_rcv_established().

Note(acme): I rewrote the patch to achieve the same result but keeping
dccp_rcv_established with the previous semantics and having it split
into __dccp_rcv_established, that doesn't does do any sanity check,
code in state != DCCP_OPEN use this lighter version as they already do
the sanity checks.

Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/input.c