aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-09-22 12:07:20 +0000
committerSteven Barth <steven@midlink.org>2014-09-22 12:07:20 +0000
commit7050d8130b17c3c570d7c53bcf2305ff276f24ad (patch)
treefa5c1dc831daf90d1f465b29b469a4ff0c98a152 /package/network/services
parentcc56566e29c8d01817840ab7d9135c9eb4f28c43 (diff)
downloadupstream-7050d8130b17c3c570d7c53bcf2305ff276f24ad.tar.gz
upstream-7050d8130b17c3c570d7c53bcf2305ff276f24ad.tar.bz2
upstream-7050d8130b17c3c570d7c53bcf2305ff276f24ad.zip
dnsmasq: fix lockup when interfaces disappear
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42648 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rw-r--r--package/network/services/dnsmasq/patches/003-fix-unresponsiveness-on-interface-disappearance.patch47
2 files changed, 48 insertions, 1 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 17af3c5d8c..6262dc5475 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_VERSION:=2.71
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
diff --git a/package/network/services/dnsmasq/patches/003-fix-unresponsiveness-on-interface-disappearance.patch b/package/network/services/dnsmasq/patches/003-fix-unresponsiveness-on-interface-disappearance.patch
new file mode 100644
index 0000000000..5ee2090d2c
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/003-fix-unresponsiveness-on-interface-disappearance.patch
@@ -0,0 +1,47 @@
+From 5782649ad95382dd558df97b33b64e854d8789fb Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Thu, 18 Sep 2014 22:08:58 +0100
+Subject: [PATCH] Fix bug which caused dnsmasq to become unresponsive when an
+ interface goes.
+
+---
+
+diff --git a/src/util.c b/src/util.c
+index df751c7..a729f33 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -570,18 +570,28 @@ void bump_maxfd(int fd, int *max)
+
+ 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)
+ {
+ waiter.tv_sec = 0;
+ waiter.tv_nsec = 10000;
+ nanosleep(&waiter, NULL);
+- return 1;
++ if (retries++ < 1000)
++ return 1;
+ }
++
++ retries = 0;
+
+ if (errno == EINTR)
+ return 1;
+-
++
+ return 0;
+ }
+
+--
+1.9.1
+