Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278563
b: refs/heads/master
c: 0bee1d6
h: refs/heads/master
i:
  278561: ad2e79c
  278559: c448a65
v: v3
  • Loading branch information
Gustavo F. Padovan committed Nov 10, 2011
1 parent 9a0f790 commit b9142b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d45fc42323b7909829b8f27f26676c675f26551f
refs/heads/master: 0bee1d60cbad24288c75573511356d450c1fd45a
16 changes: 13 additions & 3 deletions trunk/net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,18 +625,28 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch

chan->sec_level = sec.level;

if (!chan->conn)
break;

conn = chan->conn;
if (conn && chan->scid == L2CAP_CID_LE_DATA) {

/*change security for LE channels */
if (chan->scid == L2CAP_CID_LE_DATA) {
if (!conn->hcon->out) {
err = -EINVAL;
break;
}

if (smp_conn_security(conn, sec.level))
break;

err = 0;
sk->sk_state = BT_CONFIG;

/* or for ACL link, under defer_setup time */
} else if (sk->sk_state == BT_CONNECT2 &&
bt_sk(sk)->defer_setup) {
err = l2cap_chan_check_security(chan);
} else {
err = -EINVAL;
}
break;

Expand Down

0 comments on commit b9142b5

Please sign in to comment.