diff options
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index b677af671f31..8a93dde4095b 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -263,8 +263,22 @@ static void l2cap_chan_del(struct sock *sk, int err) | |||
263 | static inline int l2cap_check_security(struct sock *sk) | 263 | static inline int l2cap_check_security(struct sock *sk) |
264 | { | 264 | { |
265 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; | 265 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; |
266 | __u8 auth_type; | ||
267 | |||
268 | switch (l2cap_pi(sk)->sec_level) { | ||
269 | case BT_SECURITY_HIGH: | ||
270 | auth_type = HCI_AT_GENERAL_BONDING_MITM; | ||
271 | break; | ||
272 | case BT_SECURITY_MEDIUM: | ||
273 | auth_type = HCI_AT_GENERAL_BONDING; | ||
274 | break; | ||
275 | default: | ||
276 | auth_type = HCI_AT_NO_BONDING; | ||
277 | break; | ||
278 | } | ||
266 | 279 | ||
267 | return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level); | 280 | return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level, |
281 | auth_type); | ||
268 | } | 282 | } |
269 | 283 | ||
270 | static inline u8 l2cap_get_ident(struct l2cap_conn *conn) | 284 | static inline u8 l2cap_get_ident(struct l2cap_conn *conn) |