Re: [PATCH BlueZ] l2test: Set CID due to socket restrictions for LE

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

 



Hi Johan,

>>>> Bluetooth kernel now restricts LE L2CAP sockets to ATT channels only.
>>>> For LE L2CAP socket bind, ATT CID is now mandatory. Reference: kernel patch
>>>> bfe4655f05d7ec4a7c0c1c7e4051862f824cd8ec
>>>> ---
>>>> tools/l2test.c | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>> 
>>> Applied thanks.
>>> 
>>> Btw, I didn't realize that this check wasn't there before. It seems like
>>> it shouldn't cause any "real life" issues as our btio has always done a
>>> bind with the correct CID. Can you confirm that this should only be an
>>> issue for l2test?
>>> 
>>> Johan
>> 
>> Yes. btio calls bind with the correct CID.
>> 
>> I suspect that the is another issue in bt_io_connect() call inside
>> device_browse_primary(),
>> the source address type is missing (it is mandatory now). I will send
>> a patch to fix it.
> 
> Good catch, though we'll likely need to fix this for the kernel too so
> that we don't end up with a kernel release that breaks old user space
> versions.

whoever talked to me about adding bdaddr_type over and over again, and then not bothered to fix this in userspace, needs to stand in a corner and think about it for a long time what he has done now.

I am not amused about this at all.

>> At some point we need to infer the adapter address type instead of
>> always use public address.
> 
> To be honest, selecting whether to use a random address when scanning or
> advertising doesn't at least immediately strike me as something that
> should be done through the bind call, but instead something that should
> be a global setting for the entire adapter. Having the exact LE address
> type in connect() makes sense, but not necessarily for bind().

It does make sense to have this. Userspace knows what it is doing. Right now it is pretty simple. Either you have a public address, then that is used. If you do not have a public, then you need to configure a static address first, and then that will be used. So you know the address type that is in use.

When adding support for privacy feature then this becomes a bit more complicated, but at all times, the userspace will know how it configured the kernel. Either use public address or use random address.

Regards

Marcel

--
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