From: Marcel Holtmann Date: Wed, 4 Sep 2013 01:08:37 +0000 (-0700) Subject: Bluetooth: Disable upper layer connections when user channel is active X-Git-Tag: submit/tizen/20160607.132125~5677^2~225^2~24^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af750e942ea138553ee5693210c2f918448f58dc;p=sdk%2Femulator%2Femulator-kernel.git Bluetooth: Disable upper layer connections when user channel is active When the device has the user channel flag set, it means it is driven by an user application. In that case do not allow any connections from L2CAP or SCO sockets. This is the same situation as when the device has the raw flag set and it will then return EHOSTUNREACH. Signed-off-by: Marcel Holtmann Acked-by: Johan Hedberg Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index f081712..d2380e0 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -518,6 +518,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src) list_for_each_entry(d, &hci_dev_list, list) { if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags) || + test_bit(HCI_USER_CHANNEL, &d->dev_flags) || d->dev_type != HCI_BREDR) continue;