• Andrea Bittau's avatar
    [DCCP]: Do not process a packet twice when it's not in state DCCP_OPEN. · 709dd3aa
    Andrea Bittau authored
    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: default avatarAndrea Bittau <a.bittau@cs.ucl.ac.uk>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    709dd3aa
input.c 16.7 KB