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 <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-09-19 12:12:53 +03:00 committed by Johan Hedberg
commit bac7367b0a

View file

@ -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;
}