• Ilpo Järvinen's avatar
    tcp: consolidate paws check · c887e6d2
    Ilpo Järvinen authored
    Wow, it was quite tricky to merge that stream of negations
    but I think I finally got it right:
    
    check & replace_ts_recent:
    (s32)(rcv_tsval - ts_recent) >= 0                  => 0
    (s32)(ts_recent - rcv_tsval) <= 0                  => 0
    
    discard:
    (s32)(ts_recent - rcv_tsval)  > TCP_PAWS_WINDOW    => 1
    (s32)(ts_recent - rcv_tsval) <= TCP_PAWS_WINDOW    => 0
    
    I toggled the return values of tcp_paws_check around since
    the old encoding added yet-another negation making tracking
    of truth-values really complicated.
    Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c887e6d2
tcp.h 40.5 KB