From 4eb7bea753b65335b99c76d3ff4b9f1d241da389 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 20 Jan 2015 13:46:16 +0200 Subject: [PATCH] emulator/smp: Fix identity info PDU sending order --- emulator/smp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emulator/smp.c b/emulator/smp.c index 4f527e990..c893aba7e 100644 --- a/emulator/smp.c +++ b/emulator/smp.c @@ -393,6 +393,9 @@ static void distribute_keys(struct smp_conn *conn) } if (conn->local_key_dist & DIST_ID_KEY) { + memset(buf, 0, sizeof(buf)); + smp_send(conn, BT_L2CAP_SMP_IDENT_INFO, buf, sizeof(buf)); + memset(buf, 0, sizeof(buf)); if (conn->out) { @@ -402,10 +405,8 @@ static void distribute_keys(struct smp_conn *conn) buf[0] = conn->ra_type; memcpy(&buf[1], conn->ra, 6); } - smp_send(conn, BT_L2CAP_SMP_IDENT_ADDR_INFO, buf, 7); - memset(buf, 0, sizeof(buf)); - smp_send(conn, BT_L2CAP_SMP_IDENT_INFO, buf, sizeof(buf)); + smp_send(conn, BT_L2CAP_SMP_IDENT_ADDR_INFO, buf, 7); } if (conn->local_key_dist & DIST_SIGN) { -- 2.47.3