Commit graph

7 commits

Author SHA1 Message Date
Angus Gratton
029a155a71 Merge branch 'bugfix/mdns_add_remove_multiple_srv_3.2' into 'release/v3.2'
mdns: fix possible crash if tx packet contained answer to removed service (backport 3.2)

See merge request idf/esp-idf!4481
2019-03-14 07:56:40 +08:00
David Cermak
8fe4007dfa 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-438
2019-03-13 16:24:03 +01:00
Ivan Grokhotkov
09f4015300 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-13 14:55:01 +01:00
David Cermak
f48ffb37f2 mdns: check all mallocs for failure and add default hook to log error with free heap
solves crash about _mdns_result_txt_create when stress test
2018-12-21 16:27:58 +01:00
Piyush Shah
e5e2702ca3 bugfix: mdns_service_txt_set() wasn't allocating memory for TXT records
Allocation was happening later, causing possible use of stack variables
of caller function, which could be invalid.

Signed-off-by: Piyush Shah <piyush@espressif.com>
2018-09-11 16:23:56 +05:30
Liu Han
ba458c69cf fix(mdns): add the maximum number of services 2018-06-21 10:31:09 +08:00
me-no-dev
4bddbc031c Import mDNS changes 2018-01-16 10:58:34 +02:00