diff mbox series

[Bluez,v2] btmgmt: Fix enable adding irk when turining privacy on

Message ID 20210504111454.29697-1-sathish.narasimman@intel.com
State Superseded
Headers show
Series [Bluez,v2] btmgmt: Fix enable adding irk when turining privacy on | expand

Commit Message

Sathish Narasimman May 4, 2021, 11:14 a.m. UTC
Unable to add the IRK in btmgmt when need to be updated. The option is
enabled now.

Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
---
 tools/btmgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com May 4, 2021, 11:36 a.m. UTC | #1
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
Luiz Augusto von Dentz May 4, 2021, 5:43 p.m. UTC | #2
Hi Sathish,

On Tue, May 4, 2021 at 4:09 AM Sathish Narasimman
<sathish.narasimman@intel.com> wrote:
>
> Unable to add the IRK in btmgmt when need to be updated. The option is
> enabled now.
>
> Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
> ---
>  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
>
Marcel Holtmann May 7, 2021, 8:26 a.m. UTC | #3
Hi Luiz,

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

>> enabled now.

>> 

>> Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>

>> ---

>> 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
Luiz Augusto von Dentz May 7, 2021, 10:13 p.m. UTC | #4
Hi Marcel,

On Fri, May 7, 2021 at 1:26 AM Marcel Holtmann <marcel@holtmann.org> 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 <sathish.narasimman@intel.com>

> >> ---

> >> 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
Marcel Holtmann May 13, 2021, 3:20 p.m. UTC | #5
Hi Luiz,

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

>>>> enabled now.

>>>> 

>>>> Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>

>>>> ---

>>>> 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
Luiz Augusto von Dentz May 13, 2021, 9:11 p.m. UTC | #6
Hi Sathish,

On Tue, May 4, 2021 at 4:48 AM <bluez.test.bot@gmail.com> 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
diff mbox series

Patch

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"	},