diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/smp.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 28014ad3d2d3..7a295d7edc44 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -1375,7 +1375,7 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb) | |||
1375 | return 0; | 1375 | return 0; |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | static int smp_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) | 1378 | static int smp_sig_channel(struct l2cap_chan *chan, struct sk_buff *skb) |
1379 | { | 1379 | { |
1380 | struct l2cap_conn *conn = chan->conn; | 1380 | struct l2cap_conn *conn = chan->conn; |
1381 | struct hci_conn *hcon = conn->hcon; | 1381 | struct hci_conn *hcon = conn->hcon; |
@@ -1514,6 +1514,24 @@ static void smp_ready_cb(struct l2cap_chan *chan) | |||
1514 | l2cap_chan_hold(chan); | 1514 | l2cap_chan_hold(chan); |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | static int smp_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) | ||
1518 | { | ||
1519 | int err; | ||
1520 | |||
1521 | BT_DBG("chan %p", chan); | ||
1522 | |||
1523 | err = smp_sig_channel(chan, skb); | ||
1524 | if (err) { | ||
1525 | struct l2cap_conn *conn = chan->conn; | ||
1526 | |||
1527 | cancel_delayed_work_sync(&conn->security_timer); | ||
1528 | |||
1529 | l2cap_conn_shutdown(chan->conn, -err); | ||
1530 | } | ||
1531 | |||
1532 | return err; | ||
1533 | } | ||
1534 | |||
1517 | static struct sk_buff *smp_alloc_skb_cb(struct l2cap_chan *chan, | 1535 | static struct sk_buff *smp_alloc_skb_cb(struct l2cap_chan *chan, |
1518 | unsigned long hdr_len, | 1536 | unsigned long hdr_len, |
1519 | unsigned long len, int nb) | 1537 | unsigned long len, int nb) |