From b72b595aebb60eeae10e8d5d2257a7d3374199c7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Jan 2013 11:01:32 -0800 Subject: [PATCH] core: Add comment about loading empty key lists into the kernel --- src/adapter.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 944a69a65..8675648fa 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2010,6 +2010,14 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys, return; } + /* + * Even if the list of stored keys is empty, it is important to + * load an empty list into the kernel. That way it is ensured + * that no old keys from a previous daemon are present. + * + * In addition it is also the only way to toggle the different + * behavior for debug keys. + */ cp->debug_keys = debug_keys; cp->key_count = htobs(key_count); @@ -2097,6 +2105,11 @@ static void load_ltks(struct btd_adapter *adapter, GSList *keys) return; } + /* + * Even if the list of stored keys is empty, it is important to + * load an empty list into the kernel. That way it is ensured + * that no old keys from a previous daemon are present. + */ cp->key_count = htobs(key_count); for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) { -- 2.47.3