Zhou Yuefu 1da5cc2951 Close inherited listening sockets in forked TCP child processes
When dnsmasq forks a child to handle a TCP connection, the child
inherits copies of all listening sockets.  These are never used but
keep the underlying sockets alive in the kernel.  If a network
interface is removed and re-added while a child is running, the
parent's attempt to re-bind fails with EADDRINUSE because the child
still holds a reference.

Close all listener fds (UDP and TCP) in the child immediately after
fork in both do_tcp_connection() and swap_to_tcp().

[Original patch extended by Simon Kelley to include the TFTP listening
socket, and to extend the existing race-protection scheme for the
netlink socket to the listening sockets. Any bugs are my responsibility.]
2026-07-09 16:39:44 +01:00
…
…
…
2026-06-11 15:29:35 +01:00
…
2026-07-09 13:08:25 +01:00
…
…
…
…
2026-04-08 12:08:18 +01:00
…
S
Description
No description provided
12 MiB
Languages
C 94.3%
Perl 2.2%
HTML 1.2%
Shell 1%
Makefile 0.6%
Other 0.6%