aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f527a16a7b33..b7d02c5dd6da 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3883,8 +3883,7 @@ static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
3883 * Not only, also it occurs for expired timestamps. 3883 * Not only, also it occurs for expired timestamps.
3884 */ 3884 */
3885 3885
3886 if ((s32)(tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent) >= 0 || 3886 if (tcp_paws_check(&tp->rx_opt, 0))
3887 get_seconds() >= tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS)
3888 tcp_store_ts_recent(tp); 3887 tcp_store_ts_recent(tp);
3889 } 3888 }
3890} 3889}
@@ -3936,9 +3935,9 @@ static inline int tcp_paws_discard(const struct sock *sk,
3936 const struct sk_buff *skb) 3935 const struct sk_buff *skb)
3937{ 3936{
3938 const struct tcp_sock *tp = tcp_sk(sk); 3937 const struct tcp_sock *tp = tcp_sk(sk);
3939 return ((s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) > TCP_PAWS_WINDOW && 3938
3940 get_seconds() < tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS && 3939 return !tcp_paws_check(&tp->rx_opt, TCP_PAWS_WINDOW) &&
3941 !tcp_disordered_ack(sk, skb)); 3940 !tcp_disordered_ack(sk, skb);
3942} 3941}
3943 3942
3944/* Check segment sequence number for validity. 3943/* Check segment sequence number for validity.
@@ -5513,7 +5512,7 @@ discard:
5513 5512
5514 /* PAWS check. */ 5513 /* PAWS check. */
5515 if (tp->rx_opt.ts_recent_stamp && tp->rx_opt.saw_tstamp && 5514 if (tp->rx_opt.ts_recent_stamp && tp->rx_opt.saw_tstamp &&
5516 tcp_paws_check(&tp->rx_opt, 0)) 5515 tcp_paws_reject(&tp->rx_opt, 0))
5517 goto discard_and_undo; 5516 goto discard_and_undo;
5518 5517
5519 if (th->syn) { 5518 if (th->syn) {