diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-03-09 14:20:17 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-03-09 16:33:02 -0800 |
commit | 1033a462377d9374e9240878357620a8ad368bbf (patch) | |
tree | fc5e8757a0947d60883080b82d142dc4bdf55a26 /src/gatt-client.c | |
parent | ab3ff0d2cd5aab8bde5a99cf76e4771eefa7f7a0 (diff) | |
download | bluez-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.c | 3 |
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) |