All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/1] Fix remove temporary link key for No Bonding
@ 2011-08-22  9:55 Dmitriy Paliy
  2011-08-22  9:55 ` [PATCH BlueZ v2] " Dmitriy Paliy
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitriy Paliy @ 2011-08-22  9:55 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

Commit message is improved w.r.t. to previous proposal submission.

BR,
Dmitriy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH BlueZ v2] Fix remove temporary link key for No Bonding
  2011-08-22  9:55 [PATCH BlueZ v2 0/1] Fix remove temporary link key for No Bonding Dmitriy Paliy
@ 2011-08-22  9:55 ` Dmitriy Paliy
  2011-08-22 12:04   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitriy Paliy @ 2011-08-22  9:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy

This fixes regression caused by 33cdfcb0fabcfb5260953a13ae277b5abe9a322d.
Temporary link key should be removed after device is disconnected if
bonding information is not stored in file system.

Currently, the key is deleted only when paired device is removed, or
adapter is powered off. In case of No Bonding authentication, device is
not paired after disconnection, which results in link key left in memory.

On the other hand, device is not necessarily removed after disconnection
that also leaves unneeded temporary link key in memory.
---
 src/device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/device.c b/src/device.c
index 9dd657c..f323bf8 100644
--- a/src/device.c
+++ b/src/device.c
@@ -855,8 +855,10 @@ void device_remove_connection(struct btd_device *device, DBusConnection *conn)
 		device->disconnects = g_slist_remove(device->disconnects, msg);
 	}
 
-	if (device_is_paired(device) && !device_is_bonded(device))
+	if (device_is_paired(device) && !device_is_bonded(device)) {
+		btd_adapter_remove_bonding(device->adapter, &device->bdaddr);
 		device_set_paired(device, FALSE);
+	}
 
 	emit_property_changed(conn, device->path,
 					DEVICE_INTERFACE, "Connected",
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ v2] Fix remove temporary link key for No Bonding
  2011-08-22  9:55 ` [PATCH BlueZ v2] " Dmitriy Paliy
@ 2011-08-22 12:04   ` Luiz Augusto von Dentz
  2011-08-22 12:44     ` Dmitriy Paliy
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-08-22 12:04 UTC (permalink / raw)
  To: Dmitriy Paliy; +Cc: linux-bluetooth

Hi Dmitriy,

On Mon, Aug 22, 2011 at 12:55 PM, Dmitriy Paliy <dmitriy.paliy@nokia.com> wrote:
> This fixes regression caused by 33cdfcb0fabcfb5260953a13ae277b5abe9a322d.
> Temporary link key should be removed after device is disconnected if
> bonding information is not stored in file system.
>
> Currently, the key is deleted only when paired device is removed, or
> adapter is powered off. In case of No Bonding authentication, device is
> not paired after disconnection, which results in link key left in memory.
>
> On the other hand, device is not necessarily removed after disconnection
> that also leaves unneeded temporary link key in memory.
> ---
>  src/device.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/device.c b/src/device.c
> index 9dd657c..f323bf8 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -855,8 +855,10 @@ void device_remove_connection(struct btd_device *device, DBusConnection *conn)
>                device->disconnects = g_slist_remove(device->disconnects, msg);
>        }
>
> -       if (device_is_paired(device) && !device_is_bonded(device))
> +       if (device_is_paired(device) && !device_is_bonded(device)) {
> +               btd_adapter_remove_bonding(device->adapter, &device->bdaddr);
>                device_set_paired(device, FALSE);
> +       }

How about move btd_adapter_remove_bonding to device_set_paired e.g. if
(!value) btd_adapter_remove_bonding?

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ v2] Fix remove temporary link key for No Bonding
  2011-08-22 12:04   ` Luiz Augusto von Dentz
@ 2011-08-22 12:44     ` Dmitriy Paliy
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitriy Paliy @ 2011-08-22 12:44 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: Dmitriy Paliy, linux-bluetooth

Hi Luiz,

On Mon, Aug 22, 2011 at 3:04 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Dmitriy,
>
> On Mon, Aug 22, 2011 at 12:55 PM, Dmitriy Paliy <dmitriy.paliy@nokia.com> wrote:
>> This fixes regression caused by 33cdfcb0fabcfb5260953a13ae277b5abe9a322d.
>> Temporary link key should be removed after device is disconnected if
>> bonding information is not stored in file system.
>>
>> Currently, the key is deleted only when paired device is removed, or
>> adapter is powered off. In case of No Bonding authentication, device is
>> not paired after disconnection, which results in link key left in memory.
>>
>> On the other hand, device is not necessarily removed after disconnection
>> that also leaves unneeded temporary link key in memory.
>> ---
>>  src/device.c |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/device.c b/src/device.c
>> index 9dd657c..f323bf8 100644
>> --- a/src/device.c
>> +++ b/src/device.c
>> @@ -855,8 +855,10 @@ void device_remove_connection(struct btd_device *device, DBusConnection *conn)
>>                device->disconnects = g_slist_remove(device->disconnects, msg);
>>        }
>>
>> -       if (device_is_paired(device) && !device_is_bonded(device))
>> +       if (device_is_paired(device) && !device_is_bonded(device)) {
>> +               btd_adapter_remove_bonding(device->adapter, &device->bdaddr);
>>                device_set_paired(device, FALSE);
>> +       }
>
> How about move btd_adapter_remove_bonding to device_set_paired e.g. if
> (!value) btd_adapter_remove_bonding?

Since btd_adapter_remove_bonding is used only together with
device_set_paired(device, FALSE), it makes sense code-wise. However,
downside is that one may start thinking that device_set_paired(device,
TRUE) creates bonding, which is not so. Therefore, it looks a bit
questionable.

I will submit new proposal.

Dmitriy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-22 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22  9:55 [PATCH BlueZ v2 0/1] Fix remove temporary link key for No Bonding Dmitriy Paliy
2011-08-22  9:55 ` [PATCH BlueZ v2] " Dmitriy Paliy
2011-08-22 12:04   ` Luiz Augusto von Dentz
2011-08-22 12:44     ` Dmitriy Paliy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.