From c736de05fa21c61cc7ff700778f80b915a7ba03d Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 8 Oct 2019 11:21:10 +0300 Subject: [PATCH] Bluetooth: GATT: Replace check for CONFIG_BT_SMP Make use of bt_conn_get_security instead of accessing conn->sec_level directly. Signed-off-by: Luiz Augusto von Dentz --- subsys/bluetooth/host/gatt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 66abb984cba..10726e69eea 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1867,13 +1867,9 @@ u8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr, mask &= attr->perm; if (mask & BT_GATT_PERM_AUTHEN_MASK) { -#if defined(CONFIG_BT_SMP) - if (conn->sec_level < BT_SECURITY_L3) { + if (bt_conn_get_security(conn) < BT_SECURITY_L3) { return BT_ATT_ERR_AUTHENTICATION; } -#else - return BT_ATT_ERR_AUTHENTICATION; -#endif /* CONFIG_BT_SMP */ } if ((mask & BT_GATT_PERM_ENCRYPT_MASK)) {