Skip to content
  • Philip Withnall's avatar
    pseudotcp: Fix EOS checks in high packet loss situations · a9a149f5
    Philip Withnall authored and Olivier Crête's avatar Olivier Crête committed
    The state tracking previously assumed that if a FIN packet was sent, the
    other side received it and the preceding packets, and hence it was
    correct to sent an RST if an unexpected packet (such as a delayed
    SYN-ACK) was received.
    
    In cases where there is high packet loss, this won’t work. For example,
    peer A sends a SYN, it is received and peer B replies with a SYN-ACK
    which is also received; then peer A sends its data and a FIN, which are
    both dropped. Since it hasn’t received anything since the original SYN,
    peer B resends its SYN-ACK. If that is received, peer A was incorrectly
    treating it as an erroneous packet, and would then send a RST. In actual
    fact, it should take this as a signal that the data and FIN packets were
    dropped, and should resend them.
    
    TODO: Add unit tests
    a9a149f5