mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix bug which caused dnsmasq to become unresponsive when an interface goes.
This commit is contained in:
@@ -34,6 +34,10 @@ version 2.72
|
|||||||
Fix bug when resulted in NXDOMAIN answers instead of NODATA in
|
Fix bug when resulted in NXDOMAIN answers instead of NODATA in
|
||||||
some circumstances.
|
some circumstances.
|
||||||
|
|
||||||
|
Fix bug which caused dnsmasq to become unresponsive if it
|
||||||
|
failed to send packets due to a network interface disappearing.
|
||||||
|
Thanks to Niels Peen for spotting this.
|
||||||
|
|
||||||
|
|
||||||
version 2.71
|
version 2.71
|
||||||
Subtle change to error handling to help DNSSEC validation
|
Subtle change to error handling to help DNSSEC validation
|
||||||
|
|||||||
14
src/util.c
14
src/util.c
@@ -570,15 +570,25 @@ void bump_maxfd(int fd, int *max)
|
|||||||
|
|
||||||
int retry_send(void)
|
int retry_send(void)
|
||||||
{
|
{
|
||||||
struct timespec waiter;
|
/* Linux kernels can return EAGAIN in perpetuity when calling
|
||||||
|
sendmsg() and the relevant interface has gone. Here we loop
|
||||||
|
retrying in EAGAIN for 1 second max, to avoid this hanging
|
||||||
|
dnsmasq. */
|
||||||
|
|
||||||
|
static int retries = 0;
|
||||||
|
struct timespec waiter;
|
||||||
|
|
||||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||||
{
|
{
|
||||||
waiter.tv_sec = 0;
|
waiter.tv_sec = 0;
|
||||||
waiter.tv_nsec = 10000;
|
waiter.tv_nsec = 10000;
|
||||||
nanosleep(&waiter, NULL);
|
nanosleep(&waiter, NULL);
|
||||||
return 1;
|
if (retries++ < 1000)
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retries = 0;
|
||||||
|
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user