From: Waldemar Rymarkiewicz Date: Thu, 2 Jun 2011 12:24:52 +0000 (+0200) Subject: Bluetooth: Simplify hci_conn_accept_secure check X-Git-Tag: 2.1b_release~2496 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72e69dd5072463fc5a74da42a9f6ef05459603af;p=kernel%2Fkernel-mfld-blackbay.git Bluetooth: Simplify hci_conn_accept_secure check If the link key is secure (authenticated or combination 16 digit) the sec_level will be always BT_SECURITY_HIGH. Therefore, instead of checking the link key type simply check the sec_level on the link. Signed-off-by: Waldemar Rymarkiewicz Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 532a373d..bb91099 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -657,9 +657,7 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level) if (sec_level != BT_SECURITY_HIGH) return 1; /* Accept if non-secure is required */ - if (conn->key_type == HCI_LK_AUTH_COMBINATION || - (conn->key_type == HCI_LK_COMBINATION && - conn->pin_length == 16)) + if (conn->sec_level == BT_SECURITY_HIGH) return 1; return 0; /* Reject not secure link */