diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-03-16 11:45:45 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-03-16 17:16:46 +0100 |
commit | 58428563b5ea19c2ac8b6aca8073e48539023b26 (patch) | |
tree | a8b786cb6bc181fdf07b52b376e6693ac8f94d17 /net/bluetooth/smp.c | |
parent | 1a8bab4f390130268e5384ccf1bde47925102c72 (diff) | |
download | linux-58428563b5ea19c2ac8b6aca8073e48539023b26.tar.gz linux-58428563b5ea19c2ac8b6aca8073e48539023b26.tar.bz2 linux-58428563b5ea19c2ac8b6aca8073e48539023b26.zip |
Bluetooth: Set local OOB data flag if remote has our OOB data
If the SMP Pairing Request or Response PDU received from the remote
device indicates that it has received our OOB data we should set the
SMP_FLAG_LOCAL_OOB flag.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index c8382f4fcd5c..b8a6ce840603 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1735,6 +1735,9 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) memcpy(&smp->preq[1], req, sizeof(*req)); skb_pull(skb, sizeof(*req)); + if (req->oob_flag == SMP_OOB_PRESENT) + set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); + /* SMP over BR/EDR requires special treatment */ if (conn->hcon->type == ACL_LINK) { /* We must have a BR/EDR SC link */ @@ -1899,6 +1902,9 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb) if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) return SMP_AUTH_REQUIREMENTS; + if (rsp->oob_flag == SMP_OOB_PRESENT) + set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); + smp->prsp[0] = SMP_CMD_PAIRING_RSP; memcpy(&smp->prsp[1], rsp, sizeof(*rsp)); |