Bluetooth: Fix SMP error and response to be mutually exclusive
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 18 Aug 2014 17:33:31 +0000 (20:33 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 8 Sep 2014 17:07:54 +0000 (19:07 +0200)
commit9b7b18ef1bea82e5fc1e05da386ff57b0f60f651
tree8557808cf1ff2dba573addc33f953ec8ddfcee7a
parentb04afa0c280b7e7ced88692251d75a78c8fcb2a7
Bluetooth: Fix SMP error and response to be mutually exclusive

Returning failure from the SMP data parsing function will cause an
immediate disconnect, making any attempts to send a response PDU futile.
This patch updates the function to always either send a response or
return an error, but never both at the same time:

* In the case that HCI_LE_ENABLED is not set we want to send a Pairing Not
  Supported response but it is not required to force a disconnection, so
  do not set the error return in this case.

* If we get garbage SMP data we can just fail with the handler function
  instead of also trying to send an SMP Failure PDU.

* There's no reason to force a disconnection if we receive an unknown SMP
  command. Instead simply send a proper Command Not Supported SMP
  response.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/smp.c
This page took 0.0955 seconds and 5 git commands to generate.