Commit b1cd5fd9 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Use hdev->init/resp_addr values for smp_c1 function

Now that we have nicely tracked values of the initiator and responder
address information we can pass that directly to the smp_c1 function
without worrying e.g. about who initiated the connection. This patch
updates the two places in smp.c to use the new variables.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent cb1d68f7
...@@ -445,14 +445,9 @@ static void confirm_work(struct work_struct *work) ...@@ -445,14 +445,9 @@ static void confirm_work(struct work_struct *work)
/* Prevent mutual access to hdev->tfm_aes */ /* Prevent mutual access to hdev->tfm_aes */
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (conn->hcon->out)
ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
conn->hcon->src_type, &conn->hcon->src, conn->hcon->init_addr_type, &conn->hcon->init_addr,
conn->hcon->dst_type, &conn->hcon->dst, res); conn->hcon->resp_addr_type, &conn->hcon->resp_addr, res);
else
ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
conn->hcon->dst_type, &conn->hcon->dst,
conn->hcon->src_type, &conn->hcon->src, res);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
...@@ -492,14 +487,9 @@ static void random_work(struct work_struct *work) ...@@ -492,14 +487,9 @@ static void random_work(struct work_struct *work)
/* Prevent mutual access to hdev->tfm_aes */ /* Prevent mutual access to hdev->tfm_aes */
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (hcon->out)
ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
hcon->src_type, &hcon->src,
hcon->dst_type, &hcon->dst, res);
else
ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
hcon->dst_type, &hcon->dst, hcon->init_addr_type, &hcon->init_addr,
hcon->src_type, &hcon->src, res); hcon->resp_addr_type, &hcon->resp_addr, res);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment