Commit 2b36a562 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Use hci_conn->src address for SMP functions

The source address is now stored in hci_conn->src and so use that
one for SMP functions.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 880be4e8
...@@ -388,12 +388,12 @@ static void confirm_work(struct work_struct *work) ...@@ -388,12 +388,12 @@ static void confirm_work(struct work_struct *work)
if (conn->hcon->out) if (conn->hcon->out)
ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 0, ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 0,
&conn->hcon->hdev->bdaddr, conn->hcon->dst_type, &conn->hcon->src, conn->hcon->dst_type,
&conn->hcon->dst, res); &conn->hcon->dst, res);
else else
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->dst_type, &conn->hcon->dst, 0, conn->hcon->dst_type, &conn->hcon->dst, 0,
&conn->hcon->hdev->bdaddr, res); &conn->hcon->src, res);
if (ret) { if (ret) {
reason = SMP_UNSPECIFIED; reason = SMP_UNSPECIFIED;
goto error; goto error;
...@@ -428,12 +428,10 @@ static void random_work(struct work_struct *work) ...@@ -428,12 +428,10 @@ static void random_work(struct work_struct *work)
if (hcon->out) if (hcon->out)
ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 0, ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 0,
&hcon->hdev->bdaddr, hcon->dst_type, &hcon->dst, &hcon->src, hcon->dst_type, &hcon->dst, res);
res);
else 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, 0, &hcon->hdev->bdaddr, hcon->dst_type, &hcon->dst, 0, &hcon->src, res);
res);
if (ret) { if (ret) {
reason = SMP_UNSPECIFIED; reason = SMP_UNSPECIFIED;
goto error; goto error;
...@@ -1011,7 +1009,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force) ...@@ -1011,7 +1009,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
/* Just public address */ /* Just public address */
memset(&addrinfo, 0, sizeof(addrinfo)); memset(&addrinfo, 0, sizeof(addrinfo));
bacpy(&addrinfo.bdaddr, &conn->hcon->hdev->bdaddr); bacpy(&addrinfo.bdaddr, &conn->hcon->src);
smp_send_cmd(conn, SMP_CMD_IDENT_ADDR_INFO, sizeof(addrinfo), smp_send_cmd(conn, SMP_CMD_IDENT_ADDR_INFO, sizeof(addrinfo),
&addrinfo); &addrinfo);
......
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