diff options
author | Anderson Briglia <anderson.briglia@openbossa.org> | 2011-06-07 17:46:31 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-13 14:47:04 -0400 |
commit | b501d6a1dc21eb61cbbc54e40780084f5d517164 (patch) | |
tree | 0b431362a20681dc67bc4a0283cdc60fcfe62cd0 /net/bluetooth | |
parent | eb492e0169974ac6d168f11d1fc1e2753fe1f3b4 (diff) |
Bluetooth: Start SMP procedure
Start SMP procedure for LE connections. This modification intercepts
l2cap received frames and call proper SMP functions to start the SMP
procedure. By now, no keys are being used.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index cb68b27edc9b..865716504396 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <net/bluetooth/bluetooth.h> | 54 | #include <net/bluetooth/bluetooth.h> |
55 | #include <net/bluetooth/hci_core.h> | 55 | #include <net/bluetooth/hci_core.h> |
56 | #include <net/bluetooth/l2cap.h> | 56 | #include <net/bluetooth/l2cap.h> |
57 | #include <net/bluetooth/smp.h> | ||
57 | 58 | ||
58 | int disable_ertm; | 59 | int disable_ertm; |
59 | 60 | ||
@@ -909,12 +910,15 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) | |||
909 | __clear_chan_timer(chan); | 910 | __clear_chan_timer(chan); |
910 | l2cap_state_change(chan, BT_CONNECTED); | 911 | l2cap_state_change(chan, BT_CONNECTED); |
911 | sk->sk_state_change(sk); | 912 | sk->sk_state_change(sk); |
913 | if (smp_conn_security(conn, chan->sec_level)) | ||
914 | BT_DBG("Insufficient security"); | ||
912 | } | 915 | } |
913 | 916 | ||
914 | if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { | 917 | if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { |
915 | __clear_chan_timer(chan); | 918 | __clear_chan_timer(chan); |
916 | l2cap_state_change(chan, BT_CONNECTED); | 919 | l2cap_state_change(chan, BT_CONNECTED); |
917 | sk->sk_state_change(sk); | 920 | sk->sk_state_change(sk); |
921 | |||
918 | } else if (chan->state == BT_CONNECT) | 922 | } else if (chan->state == BT_CONNECT) |
919 | l2cap_do_start(chan); | 923 | l2cap_do_start(chan); |
920 | 924 | ||
@@ -4060,6 +4064,11 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb) | |||
4060 | l2cap_att_channel(conn, cid, skb); | 4064 | l2cap_att_channel(conn, cid, skb); |
4061 | break; | 4065 | break; |
4062 | 4066 | ||
4067 | case L2CAP_CID_SMP: | ||
4068 | if (smp_sig_channel(conn, skb)) | ||
4069 | l2cap_conn_del(conn->hcon, EACCES); | ||
4070 | break; | ||
4071 | |||
4063 | default: | 4072 | default: |
4064 | l2cap_data_channel(conn, cid, skb); | 4073 | l2cap_data_channel(conn, cid, skb); |
4065 | break; | 4074 | break; |