From af401a1c6d128edc0fdab343e0d6010ce89a138a Mon Sep 17 00:00:00 2001 From: Jakob hilmer Date: Sat, 9 Apr 2022 12:01:30 +0200 Subject: [PATCH] adapter: Fix check of DISCOVERABLE setting The test for `DISCOVERABLE` should be done with `MGMT_SETTING_DISCOVERABLE` instead of `MGMT_OP_SET_DISCOVERABLE`. Acked-by: Paul Menzel Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- src/adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 9bf6af2..665bf63 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2792,7 +2792,7 @@ static bool set_discovery_discoverable(struct btd_adapter *adapter, bool enable) return true; /* Reset discoverable filter if already set */ - if (enable && (adapter->current_settings & MGMT_OP_SET_DISCOVERABLE)) + if (enable && (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)) return true; adapter->discovery_discoverable = enable; @@ -3125,7 +3125,7 @@ static int update_discovery_filter(struct btd_adapter *adapter) /* Only attempt to overwrite current discoverable setting when not * discoverable. */ - if (!(adapter->current_settings & MGMT_OP_SET_DISCOVERABLE)) { + if (!(adapter->current_settings & MGMT_SETTING_DISCOVERABLE)) { GSList *l; for (l = adapter->discovery_list; l; l = g_slist_next(l)) { -- 2.7.4