mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MAJOR: dns: Broken kqueue events handling (BSD systems).
Some DNS related network sockets were closed without unregistering their file descriptors from their underlying kqueue event sets. This patch replaces calls to close() by fd_delete() calls to that to delete such events attached to DNS network sockets from the kqueue before closing the sockets. The bug was introduced by commit 26c6eb8 ("BUG/MAJOR: dns: restart sockets after fork()") which was backported in 1.7 so this fix has to be backported there as well. Thanks to Jim Pingle who reported it and indicated the faulty commit, and to Lukas Tribus for the trace showing the bad file descriptor.
This commit is contained in:
parent
047000a8bd
commit
64920538fc
@ -1004,7 +1004,7 @@ int dns_init_resolvers(int close_socket)
|
||||
|
||||
if (close_socket == 1) {
|
||||
if (curnameserver->dgram) {
|
||||
close(curnameserver->dgram->t.sock.fd);
|
||||
fd_delete(curnameserver->dgram->t.sock.fd);
|
||||
memset(curnameserver->dgram, '\0', sizeof(*dgram));
|
||||
dgram = curnameserver->dgram;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user