diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5887141ad641..f87534569366 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1272,10 +1272,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1272 | if (!want_cookie) | 1272 | if (!want_cookie) |
1273 | TCP_ECN_create_request(req, tcp_hdr(skb)); | 1273 | TCP_ECN_create_request(req, tcp_hdr(skb)); |
1274 | 1274 | ||
1275 | if (want_cookie) { | 1275 | if (!isn) { |
1276 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); | ||
1277 | req->cookie_ts = tmp_opt.tstamp_ok; | ||
1278 | } else if (!isn) { | ||
1279 | if (ipv6_opt_accepted(sk, skb) || | 1276 | if (ipv6_opt_accepted(sk, skb) || |
1280 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || | 1277 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || |
1281 | np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { | 1278 | np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) { |
@@ -1288,8 +1285,12 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1288 | if (!sk->sk_bound_dev_if && | 1285 | if (!sk->sk_bound_dev_if && |
1289 | ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) | 1286 | ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) |
1290 | treq->iif = inet6_iif(skb); | 1287 | treq->iif = inet6_iif(skb); |
1291 | 1288 | if (!want_cookie) { | |
1292 | isn = tcp_v6_init_sequence(skb); | 1289 | isn = tcp_v6_init_sequence(skb); |
1290 | } else { | ||
1291 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); | ||
1292 | req->cookie_ts = tmp_opt.tstamp_ok; | ||
1293 | } | ||
1293 | } | 1294 | } |
1294 | tcp_rsk(req)->snt_isn = isn; | 1295 | tcp_rsk(req)->snt_isn = isn; |
1295 | 1296 | ||