<html><body><span style="display:block;" class="xfm_55049191"><div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Hi Simon,</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">I have been investigating disappearing listeners with bind-dynamic and listen-address on OpenWrt 25.12.5 / dnsmasq 2.93. Please consider the two attached patches for review.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">I noticed that master already contains the TCP-child listener cleanup from Zhou Yuefu, extended by you, in commit 1da5cc2951d345efa2ed7206dbe86d201d9f2fe4. A local adaptation of the same approach passed my OpenWrt checks with a live TCP child and OpenVPN reload/restart. That result applies to my local 2.93 patch, not to a direct runtime test of the upstream commit. I am not resubmitting that fix.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">A separate issue remains in enumerate_interfaces(): it modifies live state before both address-family scans succeed, then can garbage-collect listeners even when a scan fails. The netlink enumerator also does not check NLM_F_DUMP_INTR. An incomplete scan can therefore remove listeners for addresses which remain configured.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">The attachments are:</span></div>
<ol start="1" style="margin:5px 0;"><li>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">902-1-shared-listener-gc-upstream.patch</span><br/><span style="font-family:Arial;font-size:12pt;line-height:14pt;">A small independent fix: advance the list cursor when release_listener() retains a shared listener. Otherwise, removing its successor can unlink the retained listener too.</span></div>
</li>
<li>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">902-2-atomic-interface-snapshot-upstream.patch</span><br/><span style="font-family:Arial;font-size:12pt;line-height:14pt;">An RFC implementation which stages interface records and auxiliary state, commits only after successful scans, and retains the previous state on failure. It rejects interrupted/failed dumps, bounds receive work and schedules retries, including bounded startup retries. Apply this after patch 1.</span></div>
</li>
</ol><div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Base: upstream master a9880c595f052d63859d6ed8aa86a3a6b007bf20.</span><br/><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Neither patch depends on OpenWrt packaging or my separate no-auto-edns proposal. The existing upstream TCP-child cleanup is unchanged.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Validation after rebasing: clean patch application, default native builds, a combined DNS-only build, configuration checks, and 96 in-process regression cases under ASan/UBSan. The regression cases use synthetic syscall fixtures; these are not live kernel integration results. LeakSanitizer was disabled. Netlink sockets are prohibited in the build environment, so live address-change, OpenWrt/musl, DNSSEC and DHCP/RA protocol acceptance remain unverified.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">One open design point is the shared iface_enumerate() contract. The RFC changes failure returns, including ENOBUFS, but does not make the separate DHCP/RA/ARP and lease-discovery consumers transactional. Their handling of partial callback effects needs review and runtime validation before treating this as a production fix.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">I used AI assistance to develop and review these changes. I would appreciate your feedback on the approach, particularly whether the stricter enumeration behaviour should be isolated to the transactional caller. The small list-cursor fix can be considered independently.</span></div>
<div><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Best regards,</span><br/><span style="font-family:Arial;font-size:12pt;line-height:14pt;">Dmitry</span></div>
</div></span></body></html>