Commit adbe695a authored by Eric Dumazet's avatar Eric Dumazet Committed by Paolo Abeni

tcp: move inet_reqsk_alloc() close to inet_reqsk_clone()

inet_reqsk_alloc() does not belong to tcp_input.c,
move it to inet_connection_sock.c instead.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c3450640
...@@ -911,6 +911,31 @@ int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req) ...@@ -911,6 +911,31 @@ int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req)
} }
EXPORT_SYMBOL(inet_rtx_syn_ack); EXPORT_SYMBOL(inet_rtx_syn_ack);
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
struct sock *sk_listener,
bool attach_listener)
{
struct request_sock *req = reqsk_alloc(ops, sk_listener,
attach_listener);
if (req) {
struct inet_request_sock *ireq = inet_rsk(req);
ireq->ireq_opt = NULL;
#if IS_ENABLED(CONFIG_IPV6)
ireq->pktopts = NULL;
#endif
atomic64_set(&ireq->ir_cookie, 0);
ireq->ireq_state = TCP_NEW_SYN_RECV;
write_pnet(&ireq->ireq_net, sock_net(sk_listener));
ireq->ireq_family = sk_listener->sk_family;
req->timeout = TCP_TIMEOUT_INIT;
}
return req;
}
EXPORT_SYMBOL(inet_reqsk_alloc);
static struct request_sock *inet_reqsk_clone(struct request_sock *req, static struct request_sock *inet_reqsk_clone(struct request_sock *req,
struct sock *sk) struct sock *sk)
{ {
......
...@@ -6986,31 +6986,6 @@ static void tcp_openreq_init(struct request_sock *req, ...@@ -6986,31 +6986,6 @@ static void tcp_openreq_init(struct request_sock *req,
#endif #endif
} }
struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
struct sock *sk_listener,
bool attach_listener)
{
struct request_sock *req = reqsk_alloc(ops, sk_listener,
attach_listener);
if (req) {
struct inet_request_sock *ireq = inet_rsk(req);
ireq->ireq_opt = NULL;
#if IS_ENABLED(CONFIG_IPV6)
ireq->pktopts = NULL;
#endif
atomic64_set(&ireq->ir_cookie, 0);
ireq->ireq_state = TCP_NEW_SYN_RECV;
write_pnet(&ireq->ireq_net, sock_net(sk_listener));
ireq->ireq_family = sk_listener->sk_family;
req->timeout = TCP_TIMEOUT_INIT;
}
return req;
}
EXPORT_SYMBOL(inet_reqsk_alloc);
/* /*
* Return true if a syncookie should be sent * Return true if a syncookie should be sent
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment