summaryrefslogtreecommitdiffstats
path: root/src/dbus-hci.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-01-16 13:27:20 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-01-16 13:27:20 +0200
commit8dc9d59d5e01a57893a927f033368255dd9551c9 (patch)
tree02ec4acb34a21d349db9ddf03f92982cc76b6fc6 /src/dbus-hci.c
parentf6646fcfe84b703d0657a0e827682702d64a4788 (diff)
Also check the local IO capability before requiring MITM
Diffstat (limited to 'src/dbus-hci.c')
-rw-r--r--src/dbus-hci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index e340d4e9..36bd0c94 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -1278,9 +1278,12 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
/* If remote requests dedicated bonding follow that lead */
if (device_get_auth(device) == 0x02 ||
device_get_auth(device) == 0x03) {
- /* If the remote has NoInputNoOutput then don't require
- * MITM, otherwise require it */
- if (device_get_cap(device) == 0x03)
+ uint8_t agent_cap = agent_get_io_capability(agent);
+
+ /* If both remote and local IO capabilities allow MITM
+ * then require it, otherwise don't */
+ if (device_get_cap(device) == 0x03 ||
+ agent_cap == 0x03)
*auth = 0x02;
else
*auth = 0x03;