summaryrefslogtreecommitdiff
path: root/src/gatt-client.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-09 14:20:17 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-09 16:33:02 -0800
commit1033a462377d9374e9240878357620a8ad368bbf (patch)
treefc5e8757a0947d60883080b82d142dc4bdf55a26 /src/gatt-client.c
parentab3ff0d2cd5aab8bde5a99cf76e4771eefa7f7a0 (diff)
downloadbluez-1033a462377d9374e9240878357620a8ad368bbf.tar.gz
gatt: Use DEFER_SETUP for EATT channels
This makes use of DEFER_SETUP mechanism to do the following checks before accepting the connection: - Checks a valid device object exits - Checks if initiator/central as if the peripheral start connecting it may cause collisions. - Checks if the limit of allowed connections has been reached.
Diffstat (limited to 'src/gatt-client.c')
-rw-r--r--src/gatt-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gatt-client.c b/src/gatt-client.c
index b2fc16b90..a54d65e30 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -2255,7 +2255,8 @@ void btd_gatt_client_eatt_connect(struct btd_gatt_client *client)
char addr[18];
int i;
- if (!(client->features & BT_GATT_CHRC_CLI_FEAT_EATT))
+ if (!(client->features & BT_GATT_CHRC_CLI_FEAT_EATT) ||
+ !btd_device_is_initiator(dev))
return;
if (bt_att_get_channels(att) == btd_opts.gatt_channels)