aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-03-16 05:45:45 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-03-16 12:16:46 -0400
commit58428563b5ea19c2ac8b6aca8073e48539023b26 (patch)
treea8b786cb6bc181fdf07b52b376e6693ac8f94d17 /net/bluetooth
parent1a8bab4f390130268e5384ccf1bde47925102c72 (diff)
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')
-rw-r--r--net/bluetooth/smp.c6
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)
1735 memcpy(&smp->preq[1], req, sizeof(*req)); 1735 memcpy(&smp->preq[1], req, sizeof(*req));
1736 skb_pull(skb, sizeof(*req)); 1736 skb_pull(skb, sizeof(*req));
1737 1737
1738 if (req->oob_flag == SMP_OOB_PRESENT)
1739 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags);
1740
1738 /* SMP over BR/EDR requires special treatment */ 1741 /* SMP over BR/EDR requires special treatment */
1739 if (conn->hcon->type == ACL_LINK) { 1742 if (conn->hcon->type == ACL_LINK) {
1740 /* We must have a BR/EDR SC link */ 1743 /* 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)
1899 if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) 1902 if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC))
1900 return SMP_AUTH_REQUIREMENTS; 1903 return SMP_AUTH_REQUIREMENTS;
1901 1904
1905 if (rsp->oob_flag == SMP_OOB_PRESENT)
1906 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags);
1907
1902 smp->prsp[0] = SMP_CMD_PAIRING_RSP; 1908 smp->prsp[0] = SMP_CMD_PAIRING_RSP;
1903 memcpy(&smp->prsp[1], rsp, sizeof(*rsp)); 1909 memcpy(&smp->prsp[1], rsp, sizeof(*rsp));
1904 1910