So far there was no dedicated mechanism for replacing DNS servers with new list. Add dns_resolve_reconfigure() API that allows to achieve that in a thread-safe manner. Introduce 3rd state in DNS context lifetime by converting from 'bool is_used' to 'enum dns_resolve_context_state state'. This new DEACTIVATING state allows to mark a DNS context as busy and safely close context without holding lock. Closing DNS context with released lock prevents deadlock in case net_context_close() has to synchronize with a separate thread executing handler passed to net_context_recv() (which is the case for example with ESP-AT WiFi driver). Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> |
||
|---|---|---|
| .. | ||
| main.c | ||