Commit graph

5983 commits

Author SHA1 Message Date
Angus Gratton 56afb3bd1c Merge branch 'backport/feature_set_redirect_function_v33' into 'release/v3.3'
Add a `esp_http_client_set_redirection` function. (backport v3.3)

See merge request idf/esp-idf!4866
2019-04-26 10:06:52 +08:00
Jiang Jiang Jian e622ee0f41 Merge branch 'bugfix/btdm_abort_if_deinit_spp_without_init_v3.3' into 'release/v3.3'
components/bt: Fix abort if call esp_spp_deinit without calling esp_spp_init

See merge request idf/esp-idf!4861
2019-04-25 20:39:36 +08:00
Konstantin Kondrashov 2d50291b05 newlib: Fix adjtime
Fixed adjtime function: While using the adjtime() function,
the time correction accumulated an error
when reading the time frequently (using gettimeofday).
2019-04-24 17:42:20 +08:00
Vikram Dattu c9b1e1df60 Add a esp_http_client_set_redirection function.
When using direct operations instead of `esp_http_client_perform`, we need a way to set redirection URL when we get 30x response codes. Added the function for the same.

User can now check status code and call `esp_http_client_set_redirection` function to enable redirection.

Related change in adf: https://gitlab.espressif.cn:6688/adf/esp-adf-internal/merge_requests/187

Closes https://github.com/espressif/esp-idf/issues/2712

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2019-04-24 14:10:10 +05:30
Angus Gratton 9a72c11e6e Merge branch 'bugfix/erase_with_vtaskdelay' into 'release/v3.3'
spi_flash: Add vTaskDelay while a long erasing

See merge request idf/esp-idf!4816
2019-04-24 15:51:35 +08:00
baohongde 39dbe7daa8 components/bt: Fix abort if call esp_spp_deinit without calling esp_spp_init 2019-04-24 11:30:04 +08:00
Konstantin Kondrashov 7a2885885c spi_flash: Add vTaskDelay while a long erasing
Added Kconfig options to enable yield operation during flash erase

Closes: https://github.com/espressif/esp-idf/issues/2083
Closes: IDFGH-261
2019-04-23 10:47:09 +00:00
Vikram Dattu d154723a84 Fix url redirection issue.
Operation:
In `esp_http_client_set_url`, we check for if old_host is same as new_host.
Delete and open new connection if host is different.

Issue:
We just pointed `client->connection_info.host` to `old_host` and reassigned it.
This made old_host and new_host always point to same location and hence, using old_host with new request.

Fix:
Made a separate copy for old_host using strdup.

Closes https://github.com/espressif/esp-idf/issues/2631

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2019-04-23 14:28:53 +05:30
Renz Christian Bagaporo 16918e400e make: fix undefined variables warning for PARTITION_TABLE_BIN
Closes https://github.com/espressif/esp-idf/issues/3136
2019-04-23 14:42:14 +08:00
zhiweijian 3295ed0995 Component/bt: add ble link timeout config in menuconfig
- add ble link timeout config in menuconfig
- disable background connection when call gatts_open
2019-04-22 21:49:59 +08:00
He Yin Ling 403268a13a Merge branch 'test/modify_mesh_ci_v3.3' into 'release/v3.3'
test: update mesh test cases for ci (backport v3.3)

See merge request idf/esp-idf!4651
2019-04-18 11:29:54 +08:00
liu zhifu 93b4c71595 esp32: fix a bug caused by signal test code
Fix a WiFi bug caused by signal test code.
2019-04-17 17:44:23 +08:00
chenyudong d6badc53eb test:update mesh test cases for test(v3.3)
add job in ci mesh test

update cases in TC_IT_MESH_EST.yml and TC_IT_MESH_COMM.yml

change the file 'components/idf_test/integration_test'
2019-04-17 17:28:31 +08:00
Jiang Jiang Jian cb7aaae35e Merge branch 'bugfix/fix_set_config_bug_for_bssid_set_v3.3' into 'release/v3.3'
wifi: fix the set config bug for bssid_set (backport v3.3)

See merge request idf/esp-idf!4802
2019-04-16 23:23:58 +08:00
zhangyanjiao 18533e132a wifi: fix the set config bug for bssid_set 2019-04-16 20:40:00 +08:00
Jiang Jiang Jian 7a7128c7a3 Merge branch 'bugfix/esp_efuse_get_pkg_ver_v3.3' into 'release/v3.3'
efuse: Fix excess data coming from uninitialized variable (backport v3.3)

See merge request idf/esp-idf!4794
2019-04-16 20:33:36 +08:00
GOPTIONS\pfrost dd76df7aee efuse: Fix excess data coming from uninitialized variable
Fixed esp_efuse_get_pkg_ver() function

Closes: https://github.com/espressif/esp-idf/pull/3309
Closes: IDFGH-976
2019-04-16 16:04:15 +08:00
Mahavir Jain deba35d2e5 cpu_start: fix warnings with CONFIG_PM_DFS_INIT_AUTO option
Closes https://github.com/espressif/esp-idf/issues/3297
2019-04-16 11:21:17 +05:30
liu zhifu 184f2f0fd6 esp32: add support for WiFi signal test
Add support for WiFi signal test
2019-04-15 10:17:14 +08:00
Jack 4b6ac69c04 refactor softap power save
1. Softap support multicast and broadcast saving and flushing when the associated stations enable IEEE80211 legacy power save(which is called modem sleep in ESP32).
2. Improve the frame saving and flushing mechanism of softap power save.
2019-04-14 19:43:09 +08:00
Jiang Jiang Jian c7d73901d0 Merge branch 'bugfix/nvs_fix_erase_any_v3.3' into 'release/v3.3'
nvs_flash: Multi-page blob erased using nvs_erase_key should be cleaned properly(v3.3)

See merge request idf/esp-idf!4765
2019-04-14 19:39:04 +08:00
Jiang Jiang Jian 76cc8c1c0c Merge branch 'bugfix/wifi_spike_power_v3.3' into 'release/v3.3'
wifi: fix the issue that the spike transmit power of WiFi is higher than…

See merge request idf/esp-idf!4762
2019-04-14 19:38:55 +08:00
Jiang Jiang Jian 38a2be75a9 Merge branch 'bugfix/btdm_fix_memory_leak_when_set_txpwr_v3.3' into 'release/v3.3'
component/bt: fix memory leak when settig tx power (backport v3.3)

See merge request idf/esp-idf!4760
2019-04-14 16:55:52 +08:00
Jack ab888394c3 wifi: fix the issue that the spike transmit power of WiFi is higher than configured when WiFi and Bluetooth coexist 2019-04-14 06:26:01 +00:00
zhiweijian b8a2b77f70 component/bt: fix memory leak when settig tx power 2019-04-14 06:25:53 +00:00
negativekelvin ef8341b5bc nvs_flash: Multi-page blob erased using nvs_erase_key should be cleaned properly
Earlier eraseItem function in Storage class would do lazy cleanup of
multi-page blobs if called using type "ANY" instead of "BLOB". It used to
just delete BLOB data and index would remain as is. Any subsequent read
would delete index entry as well. This however would return a valid
length without error if nvs_get_blob API was just used for finding
length and not reading the complete blob. This change fixes this issue.

Closes https://github.com/espressif/esp-idf/issues/3255
2019-04-14 06:23:38 +00:00
Wangjialin c31217d193 bugfix(psram): improve spi cs timing settings for psram
1. remove redundant SPI clock settings, use rom functions to set clock.
2. remove redundant SPI cs setup and hold settings.
3. for old 32Mbit psram, cs hold time must only be 0.5T due to the special driving mode.(cs_setup = 0; cs_hold = 0)
4. for new 64Mbit psram, cs hold time is recommended to be 2.5T. (cs_setup = 1, cs_setup_time = 0;cs_hold = 1, cs_hold_time = 1)
2019-04-14 06:23:24 +00:00
Jiang Jiang Jian f7177095cf Merge branch 'bugfix/name_conflict_esp32_project_ld_v3.3' into 'release/v3.3'
esp32: Rename esp32.common.ld to esp32.project.ld to avoid build errors when downgrading (v3.3)

See merge request idf/esp-idf!4732
2019-04-14 10:29:39 +08:00
Jiang Jiang Jian 0e89436769 Merge branch 'bugfix/increase_block_scan_timeout_value_v3.3' into 'release/v3.3'
esp32: increase WiFi block scan timeout value (backport v3.3)

See merge request idf/esp-idf!4696
2019-04-12 23:32:55 +08:00
Angus Gratton 40067fb50f Merge branch 'bugfix/bootloader_flash_crypt_cnt_ff_v3.3' into 'release/v3.3'
flash encryption: reduce FLASH_CRYPT_CNT bit width to 7 bits (v3.3)

See merge request idf/esp-idf!4727
2019-04-12 13:42:19 +08:00
Konstantin Kondrashov a2f00b0adf esp32/sha: Remove second enabling in esp_sha_lock_engine_common 2019-04-10 20:49:27 +08:00
Angus Gratton feecafeb0e Merge branch 'feature/mfg_util_v3.3' into 'release/v3.3'
mfg_util: Add changes to mfg_util as per changes in nvs_util (backport v3.3)

See merge request idf/esp-idf!4706
2019-04-10 15:32:05 +08:00
Angus Gratton 7bbbf2d4b3 Merge branch 'bugfix/httpd_accept_conn_v3.3' into 'release/v3.3'
esp_http_server : Only accept new connections if server has capacity to handle more (backport v3.3)

See merge request idf/esp-idf!4720
2019-04-10 13:47:09 +08:00
Hrishikesh Dhayagude 82a80005b9 Unified Provisioning: Miscellaneous fixes in BLE
1. Pass the correct conn_id to protocomm_req_handle
In transport_simple_ble_write(), passing param->exec_write.conn_id would
be invalid. Instead param->write.conn_id should be passed
Similar change in transport_simple_ble_exec_write() to use
param->exec_write.conn_id

2. simple_ble_start() assumes that the mode is BLE only and enables
Bluetooth controller accordingly. For, cases having BT + BLE like Alexa
(Provisioning over BLE + Audio over classic BT), this assumption should
be removed.
2019-04-09 11:30:54 +05:30
Angus Gratton b354c11db7 esp32: Rename esp32.common.ld to esp32.project.ld to avoid build errors when downgrading
Linker script generator produces build/esp32/esp32.common.ld from
components/esp32/ld/esp32.common.ld.in

This works fine until IDF is downgraded to V3.1 which uses components/esp32/ld/esp32.common.ld and
doesn't track build/esp32/esp32.common.ld at all.

At this point, the linker runs in the build/esp32 directory and "-T esp32.common.ld" picks up the
linker script generated .ld file, which causes mis-builds.

As reported on forums: https://esp32.com/viewtopic.php?f=13&t=9684&p=40105
2019-04-09 10:20:33 +10:00
Angus Gratton e5672e5d7f efuse/flash encryption: Reduce FLASH_CRYPT_CNT to a 7 bit efuse field
8th bit is not used by hardware.

As reported https://esp32.com/viewtopic.php?f=2&t=7800&p=40895#p40894
2019-04-09 09:57:18 +10:00
liu zhifu 3e972a3ffe esp32: increase WiFi block scan timeout value
Increase WiFi block scan internal timeout value.
2019-04-08 20:02:14 +08:00
Anurag Kar 8bd09fb0a5 esp_http_server : Test added to check limit on max_open_sockets config option 2019-04-08 11:22:12 +05:30
Anurag Kar e90c90d1f6 esp_http_server : Only accept new connections if server has capacity to handle more
This fix prevents HTTP server from accepting new connections when the total count of connected
sockets has reached the max_open_sockets limit set during configuration. The pending connections
are kept in backlog until atleast one of the connected sockets is closed. The maximum number of
connection requests that can kept in backlog is specified as backlog_conn configuration option.
Note that this modification has no effect when LRU purge is enabled.

Also added sanity check on setting for max_open_sockets during configuration.

Solution suggested by jimparis https://github.com/espressif/esp-idf/issues/3183#issue-421234265

Closes https://github.com/espressif/esp-idf/issues/3183
2019-04-08 11:21:44 +05:30
Jiang Jiang Jian eed94b87e2 Merge branch 'bugfix/coex_bt_disconn_v3.3' into 'release/v3.3'
components/coex: Fix BT disconnecting due to too many reset BB

See merge request idf/esp-idf!4680
2019-04-04 20:53:15 +08:00
Jiang Jiang Jian a218d4b925 Merge branch 'bugfix/btdm_fix_warning_when_disable_logs_v3.3' into 'release/v3.3'
components/bt: Fix warning when disable debug logs or in release mode and improve the code structure

See merge request idf/esp-idf!4619
2019-04-04 18:45:31 +08:00
Jiang Jiang Jian 015f523939 Merge branch 'bugfix/btdm_disconn_with_apple_device_v3.3' into 'release/v3.3'
components/bt: Fix disconnect with apple device(backport 3.3)

See merge request idf/esp-idf!4666
2019-04-04 18:45:13 +08:00
Jiang Jiang Jian 7196573605 Merge branch 'bugfix/heap_caps_int_overflows_v3.3' into 'release/v3.3'
heap: Add integer overflow checks on MALLOC_CAP_32BIT & MALLOC_CAP_EXEC (v3.3)

See merge request idf/esp-idf!4570
2019-04-04 17:59:40 +08:00
Jiang Jiang Jian 4a698ffb75 Merge branch 'bugfix/external_rtc_start_fail_v3.3' into 'release/v3.3'
Bugfix/external rtc start fail (v3.3)

See merge request idf/esp-idf!4663
2019-04-04 17:59:24 +08:00
Shivani Tipnis 3368783bf0 mfg_util: Add changes to mfg_util as per changes in nvs_util
revert changeson this file

Update README for mfg util

Update to correct coding style of script

(cherry picked from commit a88b4048)
2019-04-04 13:46:39 +05:30
baohongde 7e0e514127 components/coex: Fix BT disconnecting due to too many reset BB
Update coex version to 1.1.6
2019-04-04 11:47:45 +08:00
Jiang Jiang Jian 541c267af3 Merge branch 'bugfix/fix_some_sta_certification_issues_v3.3' into 'release/v3.3'
esp32: fix some STA certification issues (backport v3.3)

See merge request idf/esp-idf!4667
2019-04-04 10:27:36 +08:00
baohongde bbfe9f4efa components/bt: Fix disconnect with apple device(backport 3.3)
1. Fix disconnect with apple device
        2. Fix hci_refresh_enc_key_cmd will be ignored
        3. Fix hci_refresh_enc_key_cmd will crash
2019-04-03 17:24:52 +08:00
Shivani Tipnis 1b8dd9f173 nvs_util: Add support to include comments in csv file
Closes https://github.com/espressif/esp-idf/issues/2965

(cherry picked from commit 66e38e9bac)
2019-04-02 12:39:44 +05:30
Liu Zhi Fu dd33cec716 esp32: fix some STA certification issues
Fix following STA WFA certification issues:
1. STA HT2040 coexist
2. Disallow WEP/TKIP with HT rates
3. WPA2 improvement
4. Minor refactor for WiFi internal global variable auth_type
2019-04-02 14:48:43 +08:00
Angus Gratton 1cb29ac446 Merge branch 'feature/nvs_part_util_3.3' into 'release/v3.3'
Add support as per encryption and multipage blob changes in NVS Partition Utility (backport v3.3)

See merge request idf/esp-idf!4626
2019-04-02 13:31:57 +08:00
Angus Gratton d6ceb4a31a Merge branch 'bugfix/http_server_lf_term_hdr_backport_v3d3' into 'release/v3.3'
HTTP Server : Fix for tolerating LF terminated headers (backport v3.3)

See merge request idf/esp-idf!4658
2019-04-02 12:19:05 +08:00
maojianxin ce3d20dcd2 Fix external start fail 2019-04-02 12:54:08 +11:00
Zhang Jun Yi 1dc461ba80 soc/rtc: Bypass touchpad current to external 32k crystal oscillator 2019-04-02 12:54:08 +11:00
Jiang Jiang Jian f03382b0ff Merge branch 'feature/btdm_add_mesh_adv_type_and_srv_uuid_for_dup_scan_except_v3.3' into 'release/v3.3'
Component/bt: add mesh beacon adv and svc uuid for duplicate scan exceptional list (backport v3.3)

See merge request idf/esp-idf!4605
2019-04-01 21:49:29 +08:00
Jiang Jiang Jian 2ecd007974 Merge branch 'bugfix/btdm_modify_HCI_GET_CMD_BUF_v3.3' into 'release/v3.3'
Component/bt: modify HCI_GET_CMD_BUF (backport v3.3)

See merge request idf/esp-idf!4598
2019-04-01 21:18:18 +08:00
Anurag Kar ff01bcfd88 HTTP Server : Fix for tolerating LF terminated headers
List of changes:
* When parsing requests, count termination from LF characters only
* Correct memcpy() length parameter in httpd_unrecv() (pointed out by jimparis in GitHub issue thread)
* Use ssize_t to store results of length subtractions during parsing
* Modify some comments to reduce ambiguity

Closes https://github.com/espressif/esp-idf/issues/3182
2019-04-01 15:38:59 +05:30
zhangyanjiao 8442255ccc wifi: increase the block scan time because of changing channel will take at 30ms when BT/WiFi coexist 2019-04-01 14:49:33 +08:00
zhangyanjiao 6d2faf4172 wifi: modify wifi reason code 2019-04-01 11:29:29 +08:00
zhiweijian 826146e985 Component/bt: add mesh beacon adv and svc uuid for duplicate scan exceptional list 2019-03-28 11:13:30 +08:00
Shivani Tipnis 2faf3c9c34 nvs_util: Add support for creation of unique encryption keys
(cherry picked from commit e1f466e708c2c1b825e955ec28b70dc3058f9262)
2019-03-27 18:28:42 +05:30
Shivani Tipnis 3fedc3eb28 nvs_util: Add support for creation of unique encryption keys
(cherry picked from commit 8b88b3303d83f5f03249e7b3410f6ecabaa00396)
2019-03-26 16:14:31 +05:30
Shivani Tipnis 4148beca50 nvs_util: Fix to support write of multiple singlepage big blob data
Closes https://github.com/espressif/esp-idf/issues/3011

(cherry picked from commit 60b5cdde20)
2019-03-26 16:13:15 +05:30
Shivani Tipnis c71b38c467 nvs_util: Fix to support write of multiple singlepage big blob data
Closes https://github.com/espressif/esp-idf/issues/3011

(cherry picked from commit ce4944edf01b2a4c997eafe36b66d71f98f2fe29)
(cherry picked from commit 76e4ea7f68)
2019-03-26 16:11:38 +05:30
Shivani Tipnis 8e2b189252 nvs_util: Fix to support write of multiple singlepage big blob data Closes https://github.com/espressif/esp-idf/issues/3011
(cherry picked from commit 21688e3bffee80ddfbef5364a44dd1821e28c776)
(cherry picked from commit 3ec0f415a5)
2019-03-26 16:10:18 +05:30
baohongde dca83700f2 components/bt: Fix warning when disable debug logs or in release mode and improve the code structure 2019-03-26 14:46:36 +08:00
zhiweijian 88fe438524 Component/bt: modify HCI_GET_CMD_BUF 2019-03-22 14:59:11 +08:00
chenyudong 7f1fd0b8d3 Decouple Wifi and ESP-Mesh to reduce bin size
Do not link mesh code when mesh is not used
2019-03-22 13:01:11 +08:00
Ivan Grokhotkov 3cec8d0122 Merge branch 'bugfix/error_in_bootloader_loadprohibited_v3.3' into 'release/v3.3'
esp_tool: Exclude elf-sha256 from bootloader (backport v3.3)

See merge request idf/esp-idf!4560
2019-03-21 18:22:24 +08:00
Jiang Jiang Jian 6381817006 Merge branch 'bugfix/mesh_memory_leak_v3.3' into 'release/v3.3'
mesh: fix memory leak and group send (backport v3.3)

See merge request idf/esp-idf!4517
2019-03-21 11:45:34 +08:00
Jiang Jiang Jian 6505f82a80 Merge branch 'bugfix/btdm_fix_no_adv_report_when_scaning_with_sleep_enable_v3.3' into 'release/v3.3'
Component/bt: fix no adv report when scaning with sleep enable (backport v3.3)

See merge request idf/esp-idf!4536
2019-03-20 21:40:28 +08:00
Jiang Jiang Jian c05a0ae6c3 Merge branch 'bugfix/btdm_fix_build_warning_when_bluedroid_disable_log_v3.3' into 'release/v3.3'
Component/bt: fix build warning when bluedroid disable log (backport V3.3)

See merge request idf/esp-idf!4565
2019-03-20 21:22:33 +08:00
Angus Gratton f72df315f7 heap: Add integer overflow checks on MALLOC_CAP_32BIT & MALLOC_CAP_EXEC 2019-03-20 18:30:25 +11:00
chenyudong e7a263938b mesh: fix memory leak and group send
fix a bug in group send
fix esp_mesh_set_router when router_t not initialized
fix mesh memory leak with invalid option
2019-03-20 15:13:28 +08:00
zhiweijian 3ed0f8e113 Component/bt: fix build warning when bluedroid disable log 2019-03-20 15:02:57 +08:00
zhiweijian 7e1ccb56a7 Component/bt: fix blufi prepare write crash 2019-03-20 14:23:11 +08:00
Konstantin Kondrashov 50a0b00afa esp_tool: Exclude elf-sha256 from bootloader
Closes: IDFGH-690
2019-03-20 12:19:23 +08:00
zhiweijian 7a530be302 Component/bt: fix no adv report when scaning with sleep enable 2019-03-18 17:09:00 +08:00
zhangyanjiao b692bda09b wifi: fix the bug that when call set_config before connecting to an encrypted AP, PMK will be recalculated 2019-03-18 14:45:33 +08:00
Jiang Jiang Jian e4a83f856e Merge branch 'bugfix/mdns_add_remove_multiple_srv_master_3.3' into 'release/v3.3'
mdns: fix possible crash if tx packet contained answer to removed service (backport 3.3)

See merge request idf/esp-idf!4480
2019-03-17 15:41:34 +08:00
Jiang Jiang Jian e25152a031 Merge branch 'bugfix/esp_sha_signing_sha256_v3.3' into 'release/v3.3'
secure boot: Fix esp_sha INT WDT, switch to using mbedTLS API  (backport v3.3)

See merge request idf/esp-idf!4512
2019-03-17 14:40:21 +08:00
Jiang Jiang Jian 885aec7aba Merge branch 'bugfix/bb_watchdog_reset_v3.3' into 'release/v3.3'
esp32: add WiFi baseband watchdog reset

See merge request idf/esp-idf!4486
2019-03-15 18:49:32 +08:00
Jiang Jiang Jian a3a58546bc Merge branch 'bugfix/console_allow_buffered_v3.3' into 'release/v3.3'
console example: use buffered stdout by default (backport v3.3)

See merge request idf/esp-idf!4508
2019-03-15 16:11:30 +08:00
Angus Gratton 0176f912b6 esp32: Chunk input blocks for esp_sha() function performance, add perf test 2019-03-15 17:34:06 +11:00
Angus Gratton 615376d14a secure boot: Use mbedtls_sha256() not esp_sha()
Latter is probably compiled into most firmwares already, saves some size.

Ref https://github.com/espressif/esp-idf/issues/3127
2019-03-15 17:34:06 +11:00
Angus Gratton fe516fb7c2 esp32 hwcrypto: Prevent esp_sha() from disabling interrupts for extended period
* Closes https://github.com/espressif/esp-idf/issues/3127
* Closes IDFGH-681

Also reported at https://esp32.com/viewtopic.php?f=13&t=9506
2019-03-15 17:34:06 +11:00
Angus Gratton f5c805160b Merge branch 'bugfix/remove_malloc_ble_prov_v3.3' into 'release/v3.3'
(backport v3.3) Protocomm BLE: Make changes in handling BLE read/write requests

See merge request idf/esp-idf!4496
2019-03-15 14:29:18 +08:00
Ivan Grokhotkov 50ceb45e6f console/linenoise: support buffered stdout 2019-03-15 11:31:22 +08:00
Hrishikesh Dhayagude bd0984226e Protocomm BLE: Make changes in handling BLE read/write requests
1. Remove unwanted malloc during BLE send response
2. Populate the missing parameters in the response - handle, offset, auth_req
2019-03-14 12:53:52 +05:30
Tian Hao f330bb50b2 fix the bug assert(8192 0) in rwble.c 234 2019-03-14 11:43:16 +08:00
Liu Zhi Fu 16755a2c51 esp32: add WiFi baseband watchdog reset
When WiFi enter into a special status (11b weak mode), then reset
Wifi baseband to recover to normal mode.
2019-03-14 09:28:37 +08:00
David Cermak 936b99d756 mdns: fix possible crash when probing on particular interface with duplicated service instances due to naming conflicts on network
Issue: MDNS server initially sends probing packets to resolve naming confilicts with already registered service instances. In case of a conflict, instance name is altered and probing restarts. Original instance however wasnnot removed from the structure and upon service removal only one entry was removed and a dangling service might have been kept in the structure to bring about a crash.
Resolution: Keep only one instance of a service in the probing structure.

Closes IDF-498
2019-03-13 16:10:27 +01:00
David Cermak c88cc4950e mdns: enable pcbs before starting service thread to avoid updating pcb's internal variables from concurent tasks
possible race condition: user task runs mdns_init, which enables pcbs while mdns-task already created could execute enable/disable of the same pcbs if an appropriate system event received
2019-03-13 16:10:16 +01:00
David Cermak 54e5e440b1 mdns: fix possible deadlock on mdns deinit calling mdns_free()
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task

Closes https://github.com/espressif/esp-idf/issues/1696
2019-03-13 16:10:03 +01:00
David Cermak e8bcda3512 mdsn: fix race condition in updating packet data from user task when failed to allocate or queue a new service
Issue: mdns_service_add API allocates and queues an action to be processed in mdns task context; when allocation or queueing fails, allocated structure needs to be freed. Function _mdns_free_service did not only fee all the structures, but also updates packet data.
Resolution: Moved removal of packet data outside of _mdns_free_service function.
2019-03-13 16:09:51 +01:00
David Cermak 35a30072f4 mdns: fix possible crash when packet scheduled to transmit contained service which might have been already removed
packets scheduled to transmit are pushed to action queue and removed from tx_queue_head structure, which is searched for all remaining services and while service is removed, then service questions/asnwers are also removed from this structure. This update fixes possible crash when packet is pushed to action queue, and when service is removed, its answers are removed from tx_queue_head, but not from action queue. this could lead to a crash when the packet is poped from action queue containing questions/answers to already removed (freed) service

Closes IDF-504
2019-03-13 16:09:41 +01:00
zhiweijian a1546e0714 Component/bt: add BLE adv report flow control 2019-03-13 14:58:32 +08:00
Angus Gratton e18c7cb98d Merge branch 'bugfix/mdns_incorrect_semaphore_use' into 'master'
mdns: use binary semaphore instead of mutex when searching

See merge request idf/esp-idf!4464
2019-03-13 13:11:45 +08:00
Angus Gratton 8120efc6ed Merge branch 'bugfix/modify_dhcpserver_and_tcpip_adapter' into 'master'
modify the behavior for dhcpserver and tcpip_adapter

Closes IDFGH-557 and IDFGH-563

See merge request idf/esp-idf!4453
2019-03-13 12:54:55 +08:00
Ivan Grokhotkov eef0b5090a mdns: use binary semaphore instead of mutex when searching
mdns_search_once_t::lock is used to synchronize tasks (taken by one
task and given by the other) so it should not be a mutex.
Convert to semaphore, and rename to indicate its purpose.
2019-03-12 09:33:06 +01:00