080-prot-release-cb.patch 822 B

123456789101112131415161718192021222324252627
  1. This was added in commit 46d3ceabd8d98ed0ad10f20c595ca784e34786c5 (tcp:
  2. TCP Small Queues) but we need it for pppoatm too.
  3. --- a/include/net/sock.h
  4. +++ b/include/net/sock.h
  5. @@ -810,6 +810,8 @@ struct proto {
  6. int (*backlog_rcv) (struct sock *sk,
  7. struct sk_buff *skb);
  8. + void (*release_cb)(struct sock *sk);
  9. +
  10. /* Keeping track of sk's, looking them up, and port selection methods. */
  11. void (*hash)(struct sock *sk);
  12. void (*unhash)(struct sock *sk);
  13. --- a/net/core/sock.c
  14. +++ b/net/core/sock.c
  15. @@ -2138,6 +2138,10 @@ void release_sock(struct sock *sk)
  16. spin_lock_bh(&sk->sk_lock.slock);
  17. if (sk->sk_backlog.tail)
  18. __release_sock(sk);
  19. +
  20. + if (sk->sk_prot->release_cb)
  21. + sk->sk_prot->release_cb(sk);
  22. +
  23. sk->sk_lock.owned = 0;
  24. if (waitqueue_active(&sk->sk_lock.wq))
  25. wake_up(&sk->sk_lock.wq);