Commit 51cb927
authored
Fix race condition in WiFiGenericClass::hostByName (espressif#8672)
dns_gethostbyname, as used in hostByName, is required to run in lwIP's TCP/IP
context. This can be verified by enabling LWIP_CHECK_THREAD_SAFETY in the
sdkconfig.
Calling dns_gethostbyname from the Arduino task can trigger race conditions
in lwIP or lower layers. One possibility is a corruption of IDF's Ethernet
buffers, causing an unstoppable flood of "insufficient TX buffer size" errors,
effectively severing all Ethernet connectivity.
This patch makes sure to call dns_gethostbyname from lwIP's TCP/IP context.1 parent 8520725 commit 51cb927
1 file changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
1559 | 1560 | | |
1560 | 1561 | | |
1561 | 1562 | | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1562 | 1579 | | |
1563 | 1580 | | |
1564 | 1581 | | |
| |||
1570 | 1587 | | |
1571 | 1588 | | |
1572 | 1589 | | |
1573 | | - | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1574 | 1593 | | |
1575 | 1594 | | |
1576 | 1595 | | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
1580 | 1599 | | |
1581 | 1600 | | |
1582 | 1601 | | |
| |||
0 commit comments