Files
micropython/ports
Damien George 0b698b8241 rp2/mpnetworkport: Deregister all sys timeouts when netif is removed.
When mDNS is active on a netif it registers a lot of timeouts, namely:

    mdns_probe_and_announce
    mdns_handle_tc_question

    mdns_multicast_probe_timeout_reset_ipv4
    mdns_multicast_timeout_25ttl_reset_ipv4
    mdns_multicast_timeout_reset_ipv4
    mdns_send_multicast_msg_delayed_ipv4
    mdns_send_unicast_msg_delayed_ipv4

    mdns_multicast_probe_timeout_reset_ipv6
    mdns_multicast_timeout_25ttl_reset_ipv6
    mdns_multicast_timeout_reset_ipv6
    mdns_send_multicast_msg_delayed_ipv6
    mdns_send_unicast_msg_delayed_ipv6

These may still be active after a netif is removed, and if they are called
they will find that the mDNS state pointer in the netif is NULL and they
will crash.

These functions could be explicitly removed using `sys_untimeout()`, but
`mdns_handle_tc_question()` is static so it's not possible to access it.
Instead use the new `sys_untimeout_all_with_arg()` helper to deregister all
timeout callbacks when a netif is removed.

Fixes issue #17621.

Signed-off-by: Damien George <damien@micropython.org>
2025-07-17 13:39:10 +10:00
..
2024-03-07 16:25:17 +11:00