diff options
-rw-r--r-- | net/ipv4/tcp_input.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 28af45abe062..3ca2139a130b 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3535,7 +3535,10 @@ static bool tcp_parse_aligned_timestamp(struct tcp_sock *tp, const struct tcphdr | |||
3535 | ++ptr; | 3535 | ++ptr; |
3536 | tp->rx_opt.rcv_tsval = ntohl(*ptr); | 3536 | tp->rx_opt.rcv_tsval = ntohl(*ptr); |
3537 | ++ptr; | 3537 | ++ptr; |
3538 | tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset; | 3538 | if (*ptr) |
3539 | tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset; | ||
3540 | else | ||
3541 | tp->rx_opt.rcv_tsecr = 0; | ||
3539 | return true; | 3542 | return true; |
3540 | } | 3543 | } |
3541 | return false; | 3544 | return false; |
@@ -3560,7 +3563,7 @@ static bool tcp_fast_parse_options(const struct sk_buff *skb, | |||
3560 | } | 3563 | } |
3561 | 3564 | ||
3562 | tcp_parse_options(skb, &tp->rx_opt, 1, NULL); | 3565 | tcp_parse_options(skb, &tp->rx_opt, 1, NULL); |
3563 | if (tp->rx_opt.saw_tstamp) | 3566 | if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) |
3564 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; | 3567 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; |
3565 | 3568 | ||
3566 | return true; | 3569 | return true; |
@@ -5316,7 +5319,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | |||
5316 | int saved_clamp = tp->rx_opt.mss_clamp; | 5319 | int saved_clamp = tp->rx_opt.mss_clamp; |
5317 | 5320 | ||
5318 | tcp_parse_options(skb, &tp->rx_opt, 0, &foc); | 5321 | tcp_parse_options(skb, &tp->rx_opt, 0, &foc); |
5319 | if (tp->rx_opt.saw_tstamp) | 5322 | if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) |
5320 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; | 5323 | tp->rx_opt.rcv_tsecr -= tp->tsoffset; |
5321 | 5324 | ||
5322 | if (th->ack) { | 5325 | if (th->ack) { |