2021-05-04 11:09:47

by Sathish Narasimman

[permalink] [raw]
Subject: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on

Unable to add the IRK in btmgmt when need to be updated. The option is
enabled now.

Signed-off-by: Sathish Narasimman <[email protected]>
---
tools/btmgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 02fec1dca184..bf3b460d0f04 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = {
cmd_advertising, "Toggle LE advertising", },
{ "bredr", "<on/off>",
cmd_bredr, "Toggle BR/EDR support", },
- { "privacy", "<on/off>",
+ { "privacy", "<on/off> [irk]",
cmd_privacy, "Toggle privacy support" },
{ "class", "<major> <minor>",
cmd_class, "Set device major/minor class" },
--
2.17.1


2021-05-04 11:48:47

by bluez.test.bot

[permalink] [raw]
Subject: RE: [Bluez,v2] btmgmt: Fix enable adding irk when turining privacy on

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=476815

---Test result---

Test Summary:
CheckPatch PASS 0.34 seconds
GitLint PASS 0.13 seconds
Prep - Setup ELL PASS 48.83 seconds
Build - Prep PASS 0.11 seconds
Build - Configure PASS 8.51 seconds
Build - Make PASS 208.97 seconds
Make Check PASS 9.35 seconds
Make Dist PASS 12.80 seconds
Make Dist - Configure PASS 5.25 seconds
Make Dist - Make PASS 84.21 seconds
Build w/ext ELL - Configure PASS 8.62 seconds
Build w/ext ELL - Make PASS 198.03 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Dist - PASS
Desc: Run 'make dist' and build the distribution tarball

##############################
Test: Make Dist - Configure - PASS
Desc: Configure the source from distribution tarball

##############################
Test: Make Dist - Make - PASS
Desc: Build the source from distribution tarball

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth

2021-05-04 17:48:30

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on

Hi Sathish,

On Tue, May 4, 2021 at 4:09 AM Sathish Narasimman
<[email protected]> wrote:
>
> Unable to add the IRK in btmgmt when need to be updated. The option is
> enabled now.
>
> Signed-off-by: Sathish Narasimman <[email protected]>
> ---
> tools/btmgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
> index 02fec1dca184..bf3b460d0f04 100644
> --- a/tools/btmgmt.c
> +++ b/tools/btmgmt.c
> @@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = {
> cmd_advertising, "Toggle LE advertising", },
> { "bredr", "<on/off>",
> cmd_bredr, "Toggle BR/EDR support", },
> - { "privacy", "<on/off>",
> + { "privacy", "<on/off> [irk]",
> cmd_privacy, "Toggle privacy support" },

I wonder why you didn't incorporate in the first parameter though
given that things like privacy off [irk] makes no send, or perhaps
have a dedicated command for setting the irk so it would persist
between privacy on/off.

> { "class", "<major> <minor>",
> cmd_class, "Set device major/minor class" },
> --
> 2.17.1
>


--
Luiz Augusto von Dentz

2021-05-07 09:28:40

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on

Hi Luiz,

>> Unable to add the IRK in btmgmt when need to be updated. The option is
>> enabled now.
>>
>> Signed-off-by: Sathish Narasimman <[email protected]>
>> ---
>> tools/btmgmt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
>> index 02fec1dca184..bf3b460d0f04 100644
>> --- a/tools/btmgmt.c
>> +++ b/tools/btmgmt.c
>> @@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = {
>> cmd_advertising, "Toggle LE advertising", },
>> { "bredr", "<on/off>",
>> cmd_bredr, "Toggle BR/EDR support", },
>> - { "privacy", "<on/off>",
>> + { "privacy", "<on/off> [irk]",
>> cmd_privacy, "Toggle privacy support" },
>
> I wonder why you didn't incorporate in the first parameter though
> given that things like privacy off [irk] makes no send, or perhaps
> have a dedicated command for setting the irk so it would persist
> between privacy on/off.

that is not how the kernel API works. If you want to enable Privacy, you need to also provide the IRK. We just simplified the tool to use /dev/urandom in case it is not provided.

Regards

Marcel

2021-05-07 22:15:14

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on

Hi Marcel,

On Fri, May 7, 2021 at 1:26 AM Marcel Holtmann <[email protected]> wrote:
>
> Hi Luiz,
>
> >> Unable to add the IRK in btmgmt when need to be updated. The option is
> >> enabled now.
> >>
> >> Signed-off-by: Sathish Narasimman <[email protected]>
> >> ---
> >> tools/btmgmt.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
> >> index 02fec1dca184..bf3b460d0f04 100644
> >> --- a/tools/btmgmt.c
> >> +++ b/tools/btmgmt.c
> >> @@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = {
> >> cmd_advertising, "Toggle LE advertising", },
> >> { "bredr", "<on/off>",
> >> cmd_bredr, "Toggle BR/EDR support", },
> >> - { "privacy", "<on/off>",
> >> + { "privacy", "<on/off> [irk]",
> >> cmd_privacy, "Toggle privacy support" },
> >
> > I wonder why you didn't incorporate in the first parameter though
> > given that things like privacy off [irk] makes no send, or perhaps
> > have a dedicated command for setting the irk so it would persist
> > between privacy on/off.
>
> that is not how the kernel API works. If you want to enable Privacy, you need to also provide the IRK. We just simplified the tool to use /dev/urandom in case it is not provided.

Just to be clear I was suggesting to use a dedicated command for setting an irk:

> irk <value>

That way it is persisted, that way the tool remembers what was the
last set irk in case privacy needs to be toggled for some reason.


--
Luiz Augusto von Dentz

2021-05-13 15:23:31

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez PATCH v2] btmgmt: Fix enable adding irk when turining privacy on

Hi Luiz,

>>>> Unable to add the IRK in btmgmt when need to be updated. The option is
>>>> enabled now.
>>>>
>>>> Signed-off-by: Sathish Narasimman <[email protected]>
>>>> ---
>>>> tools/btmgmt.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
>>>> index 02fec1dca184..bf3b460d0f04 100644
>>>> --- a/tools/btmgmt.c
>>>> +++ b/tools/btmgmt.c
>>>> @@ -5277,7 +5277,7 @@ static const struct bt_shell_menu main_menu = {
>>>> cmd_advertising, "Toggle LE advertising", },
>>>> { "bredr", "<on/off>",
>>>> cmd_bredr, "Toggle BR/EDR support", },
>>>> - { "privacy", "<on/off>",
>>>> + { "privacy", "<on/off> [irk]",
>>>> cmd_privacy, "Toggle privacy support" },
>>>
>>> I wonder why you didn't incorporate in the first parameter though
>>> given that things like privacy off [irk] makes no send, or perhaps
>>> have a dedicated command for setting the irk so it would persist
>>> between privacy on/off.
>>
>> that is not how the kernel API works. If you want to enable Privacy, you need to also provide the IRK. We just simplified the tool to use /dev/urandom in case it is not provided.
>
> Just to be clear I was suggesting to use a dedicated command for setting an irk:
>
>> irk <value>
>
> That way it is persisted, that way the tool remembers what was the
> last set irk in case privacy needs to be toggled for some reason.

but btmgmt has no storage facility. It can’t remember its own name if its life depended on it ;)

Regards

Marcel


2021-05-14 00:49:57

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [Bluez,v2] btmgmt: Fix enable adding irk when turining privacy on

Hi Sathish,

On Tue, May 4, 2021 at 4:48 AM <[email protected]> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=476815
>
> ---Test result---
>
> Test Summary:
> CheckPatch PASS 0.34 seconds
> GitLint PASS 0.13 seconds
> Prep - Setup ELL PASS 48.83 seconds
> Build - Prep PASS 0.11 seconds
> Build - Configure PASS 8.51 seconds
> Build - Make PASS 208.97 seconds
> Make Check PASS 9.35 seconds
> Make Dist PASS 12.80 seconds
> Make Dist - Configure PASS 5.25 seconds
> Make Dist - Make PASS 84.21 seconds
> Build w/ext ELL - Configure PASS 8.62 seconds
> Build w/ext ELL - Make PASS 198.03 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Dist - PASS
> Desc: Run 'make dist' and build the distribution tarball
>
> ##############################
> Test: Make Dist - Configure - PASS
> Desc: Configure the source from distribution tarball
>
> ##############################
> Test: Make Dist - Make - PASS
> Desc: Build the source from distribution tarball
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.

--
Luiz Augusto von Dentz