Merge branch 'bugfix/ext_adv_param_check_v4.4' into 'release/v4.4'

Bluedroid: fix channel map of ext adv params check for v4.4

See merge request espressif/esp-idf!18890
This commit is contained in:
Jiang Jiang Jian 2022-07-06 17:21:27 +08:00
commit d949df8dcb

View File

@ -871,10 +871,10 @@ esp_err_t esp_ble_gap_ext_adv_set_params(uint8_t instance,
ESP_BLE_IS_VALID_PARAM(params->peer_addr_type, BLE_ADDR_TYPE_PUBLIC, BLE_ADDR_TYPE_RANDOM) &&
ESP_BLE_IS_VALID_PARAM(params->own_addr_type, BLE_ADDR_TYPE_PUBLIC, BLE_ADDR_TYPE_RPA_RANDOM) &&
ESP_BLE_IS_VALID_PARAM(params->filter_policy, ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST) &&
(params->interval_min <= params->interval_max) && ((params->channel_map & ADV_CHNL_ALL) == ADV_CHNL_ALL) &&
(params->interval_min <= params->interval_max) && (params->channel_map > 0) && (params->channel_map <= ADV_CHNL_ALL) &&
((params->primary_phy == ESP_BLE_GAP_PRI_PHY_1M) || (params->primary_phy == ESP_BLE_GAP_PRI_PHY_CODED)) &&
((params->secondary_phy == ESP_BLE_GAP_PHY_1M) || (params->secondary_phy == ESP_BLE_GAP_PHY_2M) ||
(params->secondary_phy == ESP_BLE_GAP_PHY_CODED)) && (params->channel_map != 0x0)){
(params->secondary_phy == ESP_BLE_GAP_PHY_CODED))){
memcpy(&arg.ext_adv_set_params.params, params, sizeof(esp_ble_gap_ext_adv_params_t));
} else {
LOG_ERROR("%s,invalid ext adv params", __func__);