Bluetooth: Specify underlying ACL security for connected sockets

On LE connections, either side may request security elevation. This
patch propogates the secuity level being requested by remote devices
to local servers and clients.

CRs-Fixed: 352637

Change-Id: Ia9ada039f0fef03c35c19d90b415423117e00e9a
Signed-off-by: Brian Gix <bgix@codeaurora.org>
This commit is contained in:
Brian Gix
2012-04-19 11:05:06 -07:00
committed by Stephen Boyd
parent 5649ab316c
commit ecee4bf570
2 changed files with 4 additions and 1 deletions

View File

@@ -505,8 +505,10 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch
memset(&sec, 0, sizeof(sec));
sec.level = l2cap_pi(sk)->sec_level;
if (sk->sk_state == BT_CONNECTED)
if (sk->sk_state == BT_CONNECTED) {
sec.key_size = l2cap_pi(sk)->conn->hcon->enc_key_size;
sec.level = l2cap_pi(sk)->conn->hcon->sec_level;
}
len = min_t(unsigned int, len, sizeof(sec));
if (copy_to_user(optval, (char *) &sec, len))