summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-03-16 15:12:34 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-03-16 15:16:08 -0400
commitcb06d366fbf88f3923951d862f8c5b03fb483b43 (patch)
tree16be6ce5d67b0c90bd7be8c260069815a485d69c /net/bluetooth/smp.c
parenta8ca617c1356cafa669dc467a386787cc1d83809 (diff)
Bluetooth: Add clarifying comment when setting local OOB flag
It might be a bit counterintuitive to set a 'local' flag based on remote data. This patch adds a clarifying comment to the pairing req/rsp handlers when setting the LOCAL_OOB flag based on the PDU received from the remote side. 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 82824213d0fb..1bd281060de2 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1735,6 +1735,10 @@ 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 the remote side's OOB flag is set it means it has
1739 * successfully received our local OOB data - therefore set the
1740 * flag to indicate that local OOB is in use.
1741 */
1738 if (req->oob_flag == SMP_OOB_PRESENT) 1742 if (req->oob_flag == SMP_OOB_PRESENT)
1739 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); 1743 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags);
1740 1744
@@ -1902,6 +1906,10 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb)
1902 if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) 1906 if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC))
1903 return SMP_AUTH_REQUIREMENTS; 1907 return SMP_AUTH_REQUIREMENTS;
1904 1908
1909 /* If the remote side's OOB flag is set it means it has
1910 * successfully received our local OOB data - therefore set the
1911 * flag to indicate that local OOB is in use.
1912 */
1905 if (rsp->oob_flag == SMP_OOB_PRESENT) 1913 if (rsp->oob_flag == SMP_OOB_PRESENT)
1906 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); 1914 set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags);
1907 1915