diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_output.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 18a3302480cb..b4ed957f201a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -668,7 +668,6 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
668 | u8 cookie_plus = (xvp != NULL && !xvp->cookie_out_never) ? | 668 | u8 cookie_plus = (xvp != NULL && !xvp->cookie_out_never) ? |
669 | xvp->cookie_plus : | 669 | xvp->cookie_plus : |
670 | 0; | 670 | 0; |
671 | bool doing_ts = ireq->tstamp_ok; | ||
672 | 671 | ||
673 | #ifdef CONFIG_TCP_MD5SIG | 672 | #ifdef CONFIG_TCP_MD5SIG |
674 | *md5 = tcp_rsk(req)->af_specific->md5_lookup(sk, req); | 673 | *md5 = tcp_rsk(req)->af_specific->md5_lookup(sk, req); |
@@ -681,7 +680,7 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
681 | * rather than TS in order to fit in better with old, | 680 | * rather than TS in order to fit in better with old, |
682 | * buggy kernels, but that was deemed to be unnecessary. | 681 | * buggy kernels, but that was deemed to be unnecessary. |
683 | */ | 682 | */ |
684 | doing_ts &= !ireq->sack_ok; | 683 | ireq->tstamp_ok &= !ireq->sack_ok; |
685 | } | 684 | } |
686 | #else | 685 | #else |
687 | *md5 = NULL; | 686 | *md5 = NULL; |
@@ -696,7 +695,7 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
696 | opts->options |= OPTION_WSCALE; | 695 | opts->options |= OPTION_WSCALE; |
697 | remaining -= TCPOLEN_WSCALE_ALIGNED; | 696 | remaining -= TCPOLEN_WSCALE_ALIGNED; |
698 | } | 697 | } |
699 | if (likely(doing_ts)) { | 698 | if (likely(ireq->tstamp_ok)) { |
700 | opts->options |= OPTION_TS; | 699 | opts->options |= OPTION_TS; |
701 | opts->tsval = TCP_SKB_CB(skb)->when; | 700 | opts->tsval = TCP_SKB_CB(skb)->when; |
702 | opts->tsecr = req->ts_recent; | 701 | opts->tsecr = req->ts_recent; |
@@ -704,7 +703,7 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
704 | } | 703 | } |
705 | if (likely(ireq->sack_ok)) { | 704 | if (likely(ireq->sack_ok)) { |
706 | opts->options |= OPTION_SACK_ADVERTISE; | 705 | opts->options |= OPTION_SACK_ADVERTISE; |
707 | if (unlikely(!doing_ts)) | 706 | if (unlikely(!ireq->tstamp_ok)) |
708 | remaining -= TCPOLEN_SACKPERM_ALIGNED; | 707 | remaining -= TCPOLEN_SACKPERM_ALIGNED; |
709 | } | 708 | } |
710 | 709 | ||
@@ -712,7 +711,7 @@ static unsigned tcp_synack_options(struct sock *sk, | |||
712 | * If the <SYN> options fit, the same options should fit now! | 711 | * If the <SYN> options fit, the same options should fit now! |
713 | */ | 712 | */ |
714 | if (*md5 == NULL && | 713 | if (*md5 == NULL && |
715 | doing_ts && | 714 | ireq->tstamp_ok && |
716 | cookie_plus > TCPOLEN_COOKIE_BASE) { | 715 | cookie_plus > TCPOLEN_COOKIE_BASE) { |
717 | int need = cookie_plus; /* has TCPOLEN_COOKIE_BASE */ | 716 | int need = cookie_plus; /* has TCPOLEN_COOKIE_BASE */ |
718 | 717 | ||