mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 16:24:28 +08:00
tools: Fix missing address type conversion for IRK loading
This commit is contained in:
parent
19b0bc8cfa
commit
876d488660
@ -99,12 +99,23 @@ static bool load_identity(uint16_t index, struct mgmt_irk_info *irk)
|
||||
return false;
|
||||
|
||||
str2ba(addr, &irk->addr.bdaddr);
|
||||
irk->addr.type = type;
|
||||
convert_hexstr(key, irk->val, sizeof(irk->val));
|
||||
|
||||
free(addr);
|
||||
free(key);
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
irk->addr.type = BDADDR_LE_PUBLIC;
|
||||
break;
|
||||
case 1:
|
||||
irk->addr.type = BDADDR_LE_RANDOM;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Invalid address type %u\n", type);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user