]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: consolidate paws check
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sat, 14 Mar 2009 14:23:03 +0000 (14:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2009 03:09:52 +0000 (20:09 -0700)
commitb7d061e0d6820cf1c05eb983cc05290400b61eed
treeee267baadce309166ceea5649292f221cd9a6766
parent4f1f855326c413e221f1513cd1825587c6d1f07a
tcp: consolidate paws check

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: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_minisocks.c