circuitpython/ports
Daniël van de Giessen 8c47ff7153 esp32/network_ppp: Correctly clean up PPP PCB after close.
If PPP is still connected, freeing the PCB will fail and thus instead we
should trigger a disconnect and wait for the lwIP callback to actually
free the PCB.

When PPP is not connected we should check if the freeing failed, warn
the user if so, and only mark the connection as inactive if not.

When all this happens during garbage collection the best case is that
the PPP connection is already dead, which means the callback will be
called immediately and cleanup will happen correctly. The worst case is
that the connection is still alive, thus we are unable to free the PCB
(lwIP won't let us) and it remains referenced in the netif_list, meaning
a use-after-free happens later when lwIP traverses that linked list.

This change does not fully prevent that, but it *does* improve how the
PPP.active(False) method on the ESP32 port behaves: It no longer
immediately tries to free (and fails), but instead triggers a disconnect
and lets the cleanup happen correctly through the status callback.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2025-08-11 12:38:37 +10:00
..
alif ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg. 2025-08-07 10:33:26 +10:00
bare-arm shared/libc/string0: Don't deref args for n==0 case. 2023-11-07 16:01:50 +11:00
cc3200 ports: Eliminate define of {U,}INT_FMT where redundant. 2025-07-25 10:54:27 +10:00
embed embed/port: Fix alloca include for Windows platforms. 2025-08-01 12:01:37 +10:00
esp32 esp32/network_ppp: Correctly clean up PPP PCB after close. 2025-08-11 12:38:37 +10:00
esp8266 py/formatfloat: Improve accuracy of float formatting code. 2025-08-01 00:47:33 +10:00
mimxrt ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg. 2025-08-07 10:33:26 +10:00
minimal all: Rename the "NORETURN" macro to "MP_NORETURN". 2025-05-13 10:36:47 +10:00
nrf nrf/drivers/bluetooth: Change soft-device download URL to self hosted. 2025-08-01 11:34:42 +10:00
pic16bit ports: Eliminate define of {U,}INT_FMT where redundant. 2025-07-25 10:54:27 +10:00
powerpc py/mpconfig,ports: Define new HEX_FMT formatting macro. 2025-07-25 10:55:28 +10:00
qemu py/mpconfig,ports: Define new HEX_FMT formatting macro. 2025-07-25 10:55:28 +10:00
renesas-ra renesas-ra/mpconfigport: Enable MICROPY_TIME_SUPPORT_Y1969_AND_BEFORE. 2025-08-04 10:41:06 +10:00
rp2 ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg. 2025-08-07 10:33:26 +10:00
samd samd/machine_i2c_target: Support I2C target mode. 2025-08-01 23:03:17 +10:00
stm32 ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg. 2025-08-07 10:33:26 +10:00
unix py/formatfloat: Improve accuracy of float formatting code. 2025-08-01 00:47:33 +10:00
webassembly webassembly/proxy_js: Reuse JsProxy ref if object matches. 2025-07-31 11:40:50 +10:00
windows shared/timeutils: Standardize supported date range on all platforms. 2025-07-09 11:54:21 +10:00
zephyr zephyr/machine_i2c_target: Implement I2CTarget class. 2025-08-01 23:03:17 +10:00