Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328020
b: refs/heads/master
c: bb68b64
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Paasch authored and David S. Miller committed Sep 20, 2012
1 parent 4163565 commit 0c8bfe8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9baa0b0364103dd726384c71db30b74044754743
refs/heads/master: bb68b64724a4fd6b93d83b39aeffa4aadb2562fc
4 changes: 4 additions & 0 deletions trunk/include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc)
return foc->len != -1;
}

extern void tcp_sock_destruct(struct sock *sk);

static inline int fastopen_init_queue(struct sock *sk, int backlog)
{
struct request_sock_queue *queue =
Expand All @@ -585,6 +587,8 @@ static inline int fastopen_init_queue(struct sock *sk, int backlog)
sk->sk_allocation);
if (queue->fastopenq == NULL)
return -ENOMEM;

sk->sk_destruct = tcp_sock_destruct;
spin_lock_init(&queue->fastopenq->lock);
}
queue->fastopenq->max_qlen = backlog;
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ void inet_sock_destruct(struct sock *sk)
pr_err("Attempt to release alive inet socket %p\n", sk);
return;
}
if (sk->sk_protocol == IPPROTO_TCP)
kfree(inet_csk(sk)->icsk_accept_queue.fastopenq);

WARN_ON(atomic_read(&sk->sk_rmem_alloc));
WARN_ON(atomic_read(&sk->sk_wmem_alloc));
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2325,6 +2325,13 @@ int tcp_disconnect(struct sock *sk, int flags)
}
EXPORT_SYMBOL(tcp_disconnect);

void tcp_sock_destruct(struct sock *sk)
{
inet_sock_destruct(sk);

kfree(inet_csk(sk)->icsk_accept_queue.fastopenq);
}

static inline bool tcp_can_repair_sock(const struct sock *sk)
{
return capable(CAP_NET_ADMIN) &&
Expand Down

0 comments on commit 0c8bfe8

Please sign in to comment.