Bluetooth: Host: Adding valid param check in send_conn_le_param_update()

Send connection parameter update request only if it contains the valid
range of values for connection intervals, latency and timeout.

Signed-off-by: Kiran Paramaswaran <kipm@oticon.com>
This commit is contained in:
Kiran Paramaswaran 2019-12-06 10:18:55 +01:00 committed by Johan Hedberg
commit d86d37a075

View file

@ -214,6 +214,11 @@ static int send_conn_le_param_update(struct bt_conn *conn,
conn->le.features[0], param->interval_min,
param->interval_max, param->latency, param->timeout);
/* Proceed only if connection parameters contains valid values*/
if (!bt_le_conn_params_valid(param)) {
return -EINVAL;
}
/* Use LE connection parameter request if both local and remote support
* it; or if local role is master then use LE connection update.
*/