aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo@padovan.org>2012-05-07 02:07:26 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-05-16 15:14:09 -0400
commitc6585a4da0c709a7a9f59aab68869298b52ca1e1 (patch)
treeebd37772e20596f5ddd92e2150b6be4107ed0e99 /net
parenta6a5568c03c4805d4d250f6bd9d468eeeb4ea059 (diff)
Bluetooth: report the right security level in getsockopt
During a security level elevation we need to keep track of the current security level of a connection until the new one is not confirmed. Signed-off-by: Gustavo Padovan <gustavo@padovan.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_sock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index f6d8e13197d6..f52d58e05d02 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -379,7 +379,10 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch
379 } 379 }
380 380
381 memset(&sec, 0, sizeof(sec)); 381 memset(&sec, 0, sizeof(sec));
382 sec.level = chan->sec_level; 382 if (chan->conn)
383 sec.level = chan->conn->hcon->sec_level;
384 else
385 sec.level = chan->sec_level;
383 386
384 if (sk->sk_state == BT_CONNECTED) 387 if (sk->sk_state == BT_CONNECTED)
385 sec.key_size = chan->conn->hcon->enc_key_size; 388 sec.key_size = chan->conn->hcon->enc_key_size;