Skip to content

Commit c736de0

Browse files
Vudentzjhedberg
authored andcommitted
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 <[email protected]>
1 parent e1ae80c commit c736de0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

subsys/bluetooth/host/gatt.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,13 +1867,9 @@ u8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
18671867

18681868
mask &= attr->perm;
18691869
if (mask & BT_GATT_PERM_AUTHEN_MASK) {
1870-
#if defined(CONFIG_BT_SMP)
1871-
if (conn->sec_level < BT_SECURITY_L3) {
1870+
if (bt_conn_get_security(conn) < BT_SECURITY_L3) {
18721871
return BT_ATT_ERR_AUTHENTICATION;
18731872
}
1874-
#else
1875-
return BT_ATT_ERR_AUTHENTICATION;
1876-
#endif /* CONFIG_BT_SMP */
18771873
}
18781874

18791875
if ((mask & BT_GATT_PERM_ENCRYPT_MASK)) {

0 commit comments

Comments
 (0)