From bac7367b0a003dcd8528df282edca6b282c103cd Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 19 Sep 2017 12:12:53 +0300 Subject: [PATCH] Bluetooth: SMP: Fix responding to Pairing Failed PDUs It makes no sense to respond with Pairing Failed PDU to another Pairing Failed PDU. Jira: ZEP-2620 Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/smp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index c748c6ae8dc..41617934da0 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -3432,7 +3432,10 @@ static void bt_smp_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) if (!atomic_test_and_clear_bit(&smp->allowed_cmds, hdr->code)) { BT_WARN("Unexpected SMP code 0x%02x", hdr->code); - smp_error(smp, BT_SMP_ERR_UNSPECIFIED); + /* Don't send error responses to error PDUs */ + if (hdr->code != BT_SMP_CMD_PAIRING_FAIL) { + smp_error(smp, BT_SMP_ERR_UNSPECIFIED); + } return; }