|
@@ -5967,6 +5967,26 @@ static void tcp_openreq_init(struct request_sock *req,
|
|
|
ireq->ir_mark = inet_request_mark(sk, skb);
|
|
|
}
|
|
|
|
|
|
+struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
|
|
|
+ struct sock *sk_listener)
|
|
|
+{
|
|
|
+ struct request_sock *req = reqsk_alloc(ops, sk_listener);
|
|
|
+
|
|
|
+ if (req) {
|
|
|
+ struct inet_request_sock *ireq = inet_rsk(req);
|
|
|
+
|
|
|
+ kmemcheck_annotate_bitfield(ireq, flags);
|
|
|
+ ireq->opt = NULL;
|
|
|
+ atomic64_set(&ireq->ir_cookie, 0);
|
|
|
+ ireq->ireq_state = TCP_NEW_SYN_RECV;
|
|
|
+ write_pnet(&ireq->ireq_net, sock_net(sk_listener));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return req;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(inet_reqsk_alloc);
|
|
|
+
|
|
|
int tcp_conn_request(struct request_sock_ops *rsk_ops,
|
|
|
const struct tcp_request_sock_ops *af_ops,
|
|
|
struct sock *sk, struct sk_buff *skb)
|
|
@@ -6004,7 +6024,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
|
|
|
goto drop;
|
|
|
}
|
|
|
|
|
|
- req = inet_reqsk_alloc(rsk_ops);
|
|
|
+ req = inet_reqsk_alloc(rsk_ops, sk);
|
|
|
if (!req)
|
|
|
goto drop;
|
|
|
|
|
@@ -6020,7 +6040,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
|
|
|
|
|
|
tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
|
|
|
tcp_openreq_init(req, &tmp_opt, skb, sk);
|
|
|
- write_pnet(&inet_rsk(req)->ireq_net, sock_net(sk));
|
|
|
|
|
|
/* Note: tcp_v6_init_req() might override ir_iif for link locals */
|
|
|
inet_rsk(req)->ir_iif = sk->sk_bound_dev_if;
|
|
@@ -6097,7 +6116,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
|
|
|
if (err || want_cookie)
|
|
|
goto drop_and_free;
|
|
|
|
|
|
- tcp_rsk(req)->listener = NULL;
|
|
|
+ tcp_rsk(req)->tfo_listener = false;
|
|
|
af_ops->queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
|
|
|
}
|
|
|
|