Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134712
b: refs/heads/master
c: c4f912e
h: refs/heads/master
v: v3
  • Loading branch information
Marcel Holtmann committed Feb 27, 2009
1 parent 150fb32 commit 88a9f20
Show file tree
Hide file tree
Showing 3 changed files with 10 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: d58daf42d29a3a4a4d4be46cf47ceee096789680
refs/heads/master: c4f912e155504e94dd4f3d63c378dab0ff03dbda
3 changes: 3 additions & 0 deletions trunk/include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#define SOL_SCO 17
#define SOL_RFCOMM 18

#define BT_DEFER_SETUP 7

#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg)
#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg)
Expand Down Expand Up @@ -108,6 +110,7 @@ struct bt_sock {
bdaddr_t dst;
struct list_head accept_q;
struct sock *parent;
u32 defer_setup;
};

struct bt_sock_list {
Expand Down
8 changes: 6 additions & 2 deletions trunk/net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
continue;
}

if (sk->sk_state == BT_CONNECTED || !newsock) {
if (sk->sk_state == BT_CONNECTED || !newsock ||
bt_sk(parent)->defer_setup) {
bt_accept_unlink(sk);
if (newsock)
sock_graft(sk, newsock);
Expand All @@ -232,7 +233,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
EXPORT_SYMBOL(bt_accept_dequeue);

int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len, int flags)
struct msghdr *msg, size_t len, int flags)
{
int noblock = flags & MSG_DONTWAIT;
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -275,6 +276,9 @@ static inline unsigned int bt_accept_poll(struct sock *parent)
struct list_head *p, *n;
struct sock *sk;

if (bt_sk(parent)->defer_setup)
return POLLIN | POLLRDNORM;

list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
if (sk->sk_state == BT_CONNECTED)
Expand Down

0 comments on commit 88a9f20

Please sign in to comment.