OSDN Git Service

adapter: Fix registering adapter with no address
authorSzymon Janc <szymon.janc@tieto.com>
Fri, 8 Feb 2013 10:03:13 +0000 (11:03 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 15 Feb 2013 12:21:58 +0000 (14:21 +0200)
adapter->bdaddr is set later in read_info_complete and current check
always returns false. Check against bdaddr received in command response
instead and fail if it is all zeros.

src/adapter.c

index 038efc2..e553626 100644 (file)
@@ -5745,7 +5745,7 @@ static void read_info_complete(uint8_t status, uint16_t length,
                goto failed;
        }
 
-       if (bacmp(&adapter->bdaddr, BDADDR_ANY)) {
+       if (bacmp(&rp->bdaddr, BDADDR_ANY) == 0) {
                error("No Bluetooth address for index %u", adapter->dev_id);
                goto failed;
        }