Re: [PATCH 1/3] Bluetooth: Fix LE SMP channel source address and source address type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Jan 15, 2015, Johan Hedberg wrote:
> On Wed, Jan 14, 2015, Marcel Holtmann wrote:
> > +	if (cid == L2CAP_CID_SMP) {
> > +		/* If usage of static address is forced or if the devices
> > +		 * does not have a public address, then listen on the static
> > +		 * address.
> > +		 *
> > +		 * In case BR/EDR has been disabled on a dual-mode controller
> > +		 * and a static address has been configued, then listen on
> > +		 * the static address instead.
> > +		 */
> > +		if (test_bit(HCI_FORCE_STATIC_ADDR, &hdev->dbg_flags) ||
> > +		    !bacmp(&hdev->bdaddr, BDADDR_ANY) ||
> > +		    (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags) &&
> > +		     bacmp(&hdev->static_addr, BDADDR_ANY))) {
> > +			bacpy(&chan->src, &hdev->static_addr);
> > +			chan->src_type = BDADDR_LE_RANDOM;
> > +		} else {
> > +			bacpy(&chan->src, &hdev->bdaddr);
> > +			chan->src_type = BDADDR_LE_PUBLIC;
> > +		}
> 
> I think this can be simply substituted with:
> 
> 	hci_copy_identity_address(hdev, &chan->src, &chan->src_type);

Actually I got this wrong. The l2cap_chan uses a different address types
than the hci_dev uses (e.g. BDADDR_LE_RANDOM vs ADDR_LE_DEV_RANDOM), so
the patch is correct. However, we might still want to later simplify
this using a helper function or macro.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux