From ac03584d41dd7a5176b78f76920d011613d7c3a1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 21 Feb 2014 11:23:22 -0800 Subject: [PATCH] core: Don't bother loading IRKs when LE is not supported --- src/adapter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 146d141be..68ce226fc 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2583,6 +2583,18 @@ static void load_irks(struct btd_adapter *adapter, GSList *irks) unsigned int id; GSList *l; + /* + * If the controller does not support Low Energy operation, + * there is no point in trying to load the identity resolving + * keys into the kernel. + * + * While there is no harm in loading keys into the kernel, + * this is an optimization since no long term keys will + * be loaded. + */ + if (!(adapter->supported_settings & MGMT_SETTING_LE)) + return; + irk_count = g_slist_length(irks); DBG("hci%u irks %zu", adapter->dev_id, irk_count); -- 2.47.3