From: Gustavo Padovan Date: Mon, 7 May 2012 06:07:26 +0000 (-0300) Subject: Bluetooth: report the right security level in getsockopt X-Git-Tag: v3.5-rc1~35^2~3^2~18^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6585a4da0c709a7a9f59aab68869298b52ca1e1;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Acked-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index f6d8e13..f52d58e 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 } memset(&sec, 0, sizeof(sec)); - sec.level = chan->sec_level; + if (chan->conn) + sec.level = chan->conn->hcon->sec_level; + else + sec.level = chan->sec_level; if (sk->sk_state == BT_CONNECTED) sec.key_size = chan->conn->hcon->enc_key_size;