|
@@ -227,11 +227,12 @@ static struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
|
|
struct sock *child;
|
|
struct sock *child;
|
|
|
|
|
|
child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst);
|
|
child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst);
|
|
- if (child)
|
|
|
|
|
|
+ if (child) {
|
|
|
|
+ atomic_set(&req->rsk_refcnt, 1);
|
|
inet_csk_reqsk_queue_add(sk, req, child);
|
|
inet_csk_reqsk_queue_add(sk, req, child);
|
|
- else
|
|
|
|
|
|
+ } else {
|
|
reqsk_free(req);
|
|
reqsk_free(req);
|
|
-
|
|
|
|
|
|
+ }
|
|
return child;
|
|
return child;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -356,7 +357,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
|
|
ireq->opt = tcp_v4_save_options(skb);
|
|
ireq->opt = tcp_v4_save_options(skb);
|
|
|
|
|
|
if (security_inet_conn_request(sk, skb, req)) {
|
|
if (security_inet_conn_request(sk, skb, req)) {
|
|
- reqsk_put(req);
|
|
|
|
|
|
+ reqsk_free(req);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -377,7 +378,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
|
|
security_req_classify_flow(req, flowi4_to_flowi(&fl4));
|
|
security_req_classify_flow(req, flowi4_to_flowi(&fl4));
|
|
rt = ip_route_output_key(sock_net(sk), &fl4);
|
|
rt = ip_route_output_key(sock_net(sk), &fl4);
|
|
if (IS_ERR(rt)) {
|
|
if (IS_ERR(rt)) {
|
|
- reqsk_put(req);
|
|
|
|
|
|
+ reqsk_free(req);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|