aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-02-08 20:48:38 -0500
committerMarcel Holtmann <marcel@holtmann.org>2009-02-27 00:14:40 -0500
commit0684e5f9fb9e3f7e168ab831dfca693bcb44805b (patch)
tree1fb1315dff64ef2ebaa24729988b2c3b7c77d578 /net/bluetooth/rfcomm
parentefc7688b557dd1be10eead7399b315efcb1dbc74 (diff)
Bluetooth: Use general bonding whenever possible
When receiving incoming connection to specific services, always use general bonding. This ensures that the link key gets stored and can be used for further authentications. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r--net/bluetooth/rfcomm/core.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 3717c25ba33a..1828ec06ad1c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -226,8 +226,22 @@ static int rfcomm_l2sock_create(struct socket **sock)
226static inline int rfcomm_check_security(struct rfcomm_dlc *d) 226static inline int rfcomm_check_security(struct rfcomm_dlc *d)
227{ 227{
228 struct sock *sk = d->session->sock->sk; 228 struct sock *sk = d->session->sock->sk;
229 __u8 auth_type;
229 230
230 return hci_conn_security(l2cap_pi(sk)->conn->hcon, d->sec_level); 231 switch (d->sec_level) {
232 case BT_SECURITY_HIGH:
233 auth_type = HCI_AT_GENERAL_BONDING_MITM;
234 break;
235 case BT_SECURITY_MEDIUM:
236 auth_type = HCI_AT_GENERAL_BONDING;
237 break;
238 default:
239 auth_type = HCI_AT_NO_BONDING;
240 break;
241 }
242
243 return hci_conn_security(l2cap_pi(sk)->conn->hcon, d->sec_level,
244 auth_type);
231} 245}
232 246
233/* ---- RFCOMM DLCs ---- */ 247/* ---- RFCOMM DLCs ---- */