diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2011-06-14 13:37:41 -0300 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:38:48 -0800 |
commit | f663e347086a2b63ac0ab84e4e971ad36640b9a7 (patch) | |
tree | 097971bf70c47e1bd5cac2fa702cc44b52d08f48 | |
parent | 18a59ab31904dd5a03f9dcb3e67b103e6167b000 (diff) |
Bluetooth: Add support for SMP timeout
This patch adds support for disconnecting the link when SMP procedure
takes more than 30 seconds.
SMP begins when either the Pairing Request command is sent or the
Pairing Response is received, and it ends when the link is encrypted
(or terminated). Vol 3, Part H Section 3.4.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | include/net/bluetooth/l2cap.h | 2 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 4f34ad25e75c..7493317a91d9 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -418,6 +418,8 @@ struct l2cap_conn { struct timer_list security_timer; + struct timer_list security_timer; + struct list_head chan_l; rwlock_t chan_lock; }; diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 391888b88a92..c45dd737cdde 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -270,6 +270,9 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) mod_timer(&conn->security_timer, jiffies + msecs_to_jiffies(SMP_TIMEOUT)); + mod_timer(&conn->security_timer, jiffies + + msecs_to_jiffies(SMP_TIMEOUT)); + return 0; } |