Skip to contentSkip to conversation

3.19-rc1 refuse connection from bluetooth headset

DISCUSSION Pali Rohár 3 participants 7 messages Dec 24, 2014 – Feb 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

now I installed 3.19-rc1 kernel and my bluetooth headset was refused to connect automatically. I need to start connection manually from laptop (and then it working). Before when I started bluetooth headset it automatically connected and I did not have to do anything. Now with 3.19-rc1 kernel I need to do connection manually and I see error messages in hcidump:

 $ sudo hcidump 
 HCI sniffer - Bluetooth packet analyzer ver 2.2
 device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
Quoted 1 line

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7
bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

status 0x0f handle 34 bdaddr <HEADSET_ADDRESS> type ACL encrypt 0x00
Error: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7
bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

status 0x0f handle 35 bdaddr <HEADSET_ADDRESS> type ACL encrypt 0x00
Error: Connection Rejected due to Unacceptable BD_ADDR

(real address of my bluetooth headset was replaced by <HEADSET_ADDRESS>)

Can you inspect why new kernel refuse connection from my bluetooth headset?

I'm still using bluez 4.98 (which is in Ubuntu 12.04), I did not do any update.

Signature · 2 lines
Pali Rohár
[email protected]
#1 lore raw

Hi Pali,

Quoted 28 lines · Pali Rohár

now I installed 3.19-rc1 kernel and my bluetooth headset was refused to connect automatically. I need to start connection manually from laptop (and then it working). Before when I started bluetooth headset it automatically connected and I did not have to do anything. Now with 3.19-rc1 kernel I need to do connection manually and I see error messages in hcidump:

 $ sudo hcidump 
 HCI sniffer - Bluetooth packet analyzer ver 2.2
 device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
Quoted 1 line

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7
bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

status 0x0f handle 34 bdaddr <HEADSET_ADDRESS> type ACL encrypt 0x00
Error: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7
bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00 ncmd 1
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

Quoted 8 lines

status 0x0f handle 35 bdaddr <HEADSET_ADDRESS> type ACL encrypt 0x00
Error: Connection Rejected due to Unacceptable BD_ADDR

(real address of my bluetooth headset was replaced by <HEADSET_ADDRESS>)

Can you inspect why new kernel refuse connection from my bluetooth headset?

I'm still using bluez 4.98 (which is in Ubuntu 12.04), I did not do any update.

Could you try the attached patch? I think the reason might be the dependence on the HCI_CONNECTABLE flag that's only set if the page scan was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan

net/bluetooth/hci_event.c +2 -1
index c03d4b09caa3..898dfd7ceeee 100644
@@ -2197,7 +2197,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
 		return;
 	}
 
-	if (!test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
+	if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
+	    !test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
 	    !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,
 				    BDADDR_BREDR)) {
 		    hci_reject_conn(hdev, &ev->bdaddr);
#2 lore raw
Quoted 67 lines · On Wednesday 24 December 2014 18:36:52 Johan Hedberg wrote:

Hi Pali,

Quoted 55 lines · Pali Rohár

now I installed 3.19-rc1 kernel and my bluetooth headset was refused to connect automatically. I need to start connection manually from laptop (and then it working). Before when I started bluetooth headset it automatically connected and I did not have to do anything. Now with 3.19-rc1 kernel I need to do connection manually and I see error

messages in hcidump:

 $ sudo hcidump
 HCI sniffer - Bluetooth packet analyzer ver 2.2
 device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
Quoted 2 lines

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7

bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 3 lines

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00
     ncmd 1
Quoted 3 lines

HCI Event: Connect Complete (0x03) plen 11

     status 0x0f handle 34 bdaddr <HEADSET_ADDRESS> type ACL
     encrypt 0x00 Error: Connection Rejected due to
     Unacceptable BD_ADDR
Quoted 3 lines

HCI Event: Connect Request (0x04) plen 10

     bdaddr <HEADSET_ADDRESS> class 0x240404 type ACL

< HCI Command: Reject Connection Request (0x01|0x000a) plen 7

bdaddr <HEADSET_ADDRESS> reason 0x0f
Reason: Connection Rejected due to Unacceptable BD_ADDR

Quoted 3 lines

HCI Event: Command Status (0x0f) plen 4

     Reject Connection Request (0x01|0x000a) status 0x00
     ncmd 1
Quoted 3 lines

HCI Event: Connect Complete (0x03) plen 11

    status 0x0f handle 35 bdaddr <HEADSET_ADDRESS> type ACL
    encrypt 0x00 Error: Connection Rejected due to
    Unacceptable BD_ADDR
Quoted 8 lines

(real address of my bluetooth headset was replaced by <HEADSET_ADDRESS>)

Can you inspect why new kernel refuse connection from my bluetooth headset?

I'm still using bluez 4.98 (which is in Ubuntu 12.04), I did not do any update.

Quoted 6 lines

Could you try the attached patch? I think the reason might be the dependence on the HCI_CONNECTABLE flag that's only set if the page scan was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan

Hi Johan! Thanks for quick reply. Your patch fixes my problem and auto-connection of my bluetooth headset is working again. Will you forward patch to mainline kernel?

Signature · 2 lines
Pali Rohár
[email protected]
#3 lore raw

Hi Pali,

Quoted 10 lines · Pali Rohár
Quoted 6 lines

Could you try the attached patch? I think the reason might be the dependence on the HCI_CONNECTABLE flag that's only set if the page scan was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan

Hi Johan! Thanks for quick reply. Your patch fixes my problem and auto-connection of my bluetooth headset is working again. Will you forward patch to mainline kernel?

Yes, we'll tag it from 3.17.x onwards where this was introduced.

Johan

#4 lore raw
Quoted 10 lines · On Wednesday 24 December 2014 19:37:37 Johan Hedberg wrote:

Hi Pali,

Quoted 7 lines · Pali Rohár
Quoted 6 lines

Could you try the attached patch? I think the reason might be the dependence on the HCI_CONNECTABLE flag that's only set if the page scan was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan

Quoted 8 lines
Quoted 3 lines

Hi Johan! Thanks for quick reply. Your patch fixes my problem and auto-connection of my bluetooth headset is working again. Will you forward patch to mainline kernel?

Yes, we'll tag it from 3.17.x onwards where this was introduced.

Johan

Ok, you can add my Tested-by line to patch.

Signature · 2 lines
Pali Rohár
[email protected]
#5 lore raw

Hi Johan,

I met similar issue in kernel 3.10 for Chromebook smart lock feature, I have merged your patch but issue still happened.

Also, issue was unable to reproduce once I remove the code as below, thanks.

#if 0
        /* Require HCI_CONNECTABLE or a whitelist entry to accept the
         * connection. These features are only touched through mgmt so
         * only do the checks if HCI_MGMT is set.
         */
        if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
            !test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
            !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,
                                    BDADDR_BREDR)) {
                    hci_reject_conn(hdev, &ev->bdaddr);
                    return;
        }

#endif

Quoted 1 line

HCI Event: Connect Request (0x04) plen 10 [hci0] 109.033033

Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
Class: 0x5a020c
Major class: Phone (cellular, cordless, payphone, modem) Minor class: Smart phone
Networking (LAN, Ad hoc)
Capturing (Scanner, Microphone)
Object Transfer (v-Inbox, v-Folder)
Telephony (Cordless telephony, Modem, Headset)
Link type: ACL (0x01)
< HCI Command: Reject Connection Request (0x01|0x000a) plen 7

                                                            [hci0]
109.033253
        Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
        Reason: Connection Rejected due to Unacceptable BD_ADDR (0x0f)
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 109.034026

      Reject Connection Request (0x01|0x000a) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11 [hci0] 109.116034

        Status: Connection Rejected due to Unacceptable BD_ADDR (0x0f)
        Handle: 65535
        Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)
Quoted 1 line

HCI Event: Connect Request (0x04) plen 10 [hci0] 110.159024

Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
Class: 0x5a020c
Major class: Phone (cellular, cordless, payphone, modem) Minor class: Smart phone
Networking (LAN, Ad hoc)
Capturing (Scanner, Microphone)
Object Transfer (v-Inbox, v-Folder)
Telephony (Cordless telephony, Modem, Headset)
Link type: ACL (0x01)
< HCI Command: Reject Connection Request (0x01|0x000a) plen 7

                                                            [hci0]
110.159079
        Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
        Reason: Connection Rejected due to Unacceptable BD_ADDR (0x0f)
Quoted 1 line

HCI Event: Command Status (0x0f) plen 4 [hci0] 110.160018

      Reject Connection Request (0x01|0x000a) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11 [hci0] 110.248103

        Status: Connection Rejected due to Unacceptable BD_ADDR (0x0f)
        Handle: 65535
        Address: BC:F5:AC:70:16:D3 (OUI BC-F5-AC)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)

Ethan

2014-12-25 2:41 GMT+08:00 Pali Rohár <[email protected]>:

Quoted 26 lines · On Wednesday 24 December 2014 19:37:37 Johan Hedberg wrote:
Quoted 10 lines

Hi Pali,

Quoted 7 lines · Pali Rohár
Quoted 6 lines

Could you try the attached patch? I think the reason might be the dependence on the HCI_CONNECTABLE flag that's only set if the page scan was enabled through mgmt (which wouldn't be the case with BlueZ 4.98).

Johan

Quoted 8 lines
Quoted 3 lines

Hi Johan! Thanks for quick reply. Your patch fixes my problem and auto-connection of my bluetooth headset is working again. Will you forward patch to mainline kernel?

Yes, we'll tag it from 3.17.x onwards where this was introduced.

Johan

Ok, you can add my Tested-by line to patch.

--
Pali Rohár
[email protected]

#6 lore raw

Hi Ethan,

Quoted 2 lines · Ethan

I met similar issue in kernel 3.10 for Chromebook smart lock feature, I have merged your patch but issue still happened.

The whole feature of checking the whitelist when HCI_CONNECTABLE is not set was introduced only in kernel version 3.18. So it makes no sense to try to backport my patch to 3.10. If you have issues with 3.10 without my patch then it's something else that's going on and that deserves a separate email thread.

Johan