Bluetooth: Remove bogus condition for setting IRK for an identity

Just like we set the address for an identity without depending on the
BT_DEV_READY flag, we should do the same for the IRK. Otherwise we
risk getting an all-zeroes IRK. Remove the condition and always set
the IRK value whenever CONFIG_BT_PRIVACY is enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2018-09-15 21:25:05 +03:00 committed by Johan Hedberg
commit b4d7c2906b

View file

@ -4844,7 +4844,7 @@ static void id_create(u8_t id, bt_addr_le_t *addr, u8_t *irk)
}
#if defined(CONFIG_BT_PRIVACY)
if (atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
{
u8_t zero_irk[16] = { 0 };
if (irk && memcmp(irk, zero_irk, 16)) {