2011-06-14 11:30:14

by Dmitriy Paliy

[permalink] [raw]
Subject: [PATCH] Fix remove device alias when bonding deleted

Device alias is removed together with bonding information, such that
new pairing does not reuse old name. This is useful in cases when
name of paired device was changed after it was ones deleted.
---
src/device.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/device.c b/src/device.c
index 4ffc124..47d1c05 100644
--- a/src/device.c
+++ b/src/device.c
@@ -965,6 +965,11 @@ void device_remove_bonding(struct btd_device *device)
/* Delete the link key from storage */
textfile_casedel(filename, dstaddr);

+ create_name(filename, PATH_MAX, STORAGEDIR, srcaddr,
+ "aliases");
+ /* Remove alias when bonding is deleted */
+ textfile_casedel(filename, dstaddr);
+
btd_adapter_remove_bonding(device->adapter, &device->bdaddr);
}

--
1.7.4.1



2011-06-14 13:22:04

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Fix remove device alias when bonding deleted

Hi Dmitriy,

On Tue, Jun 14, 2011, Dmitriy Paliy wrote:
> Device alias is removed together with bonding information, such that
> new pairing does not reuse old name. This is useful in cases when
> name of paired device was changed after it was ones deleted.
> ---
> src/device.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)

Applied. Thanks.

Johan