mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
Bluetooth: add close() callback to l2cap_chan_ops
close() calls l2cap_sock_kill() on l2cap_sock.c Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
2307049422
commit
ba3bd0ee39
3 changed files with 19 additions and 11 deletions
|
@ -713,7 +713,7 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms
|
|||
/* Kill socket (only if zapped and orphan)
|
||||
* Must be called on unlocked socket.
|
||||
*/
|
||||
void l2cap_sock_kill(struct sock *sk)
|
||||
static void l2cap_sock_kill(struct sock *sk)
|
||||
{
|
||||
if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
|
||||
return;
|
||||
|
@ -796,10 +796,18 @@ static int l2cap_sock_recv_cb(void *data, struct sk_buff *skb)
|
|||
return sock_queue_rcv_skb(sk, skb);
|
||||
}
|
||||
|
||||
static void l2cap_sock_close_cb(void *data)
|
||||
{
|
||||
struct sock *sk = data;
|
||||
|
||||
l2cap_sock_kill(sk);
|
||||
}
|
||||
|
||||
static struct l2cap_ops l2cap_chan_ops = {
|
||||
.name = "L2CAP Socket Interface",
|
||||
.new_connection = l2cap_sock_new_connection_cb,
|
||||
.recv = l2cap_sock_recv_cb,
|
||||
.close = l2cap_sock_close_cb,
|
||||
};
|
||||
|
||||
static void l2cap_sock_destruct(struct sock *sk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue