aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-09-23 15:30:26 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-09-23 15:30:26 +0000
commit2bff540bda42936c0beff4136cf0f73466f9735c (patch)
treef5851e41e794ed49250730499bfa707f17227808
parent4d7fa7939c93b835990b0bb58aa5e69879ab83fb (diff)
downloadmaster-187ad058-2bff540bda42936c0beff4136cf0f73466f9735c.tar.gz
master-187ad058-2bff540bda42936c0beff4136cf0f73466f9735c.tar.bz2
master-187ad058-2bff540bda42936c0beff4136cf0f73466f9735c.zip
fix dnsmasq errors that occur on linux 2.4 if ipv6 is compiled as module, but not used
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12664 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/dnsmasq/patches/103-ipv6_fix.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/package/dnsmasq/patches/103-ipv6_fix.patch b/package/dnsmasq/patches/103-ipv6_fix.patch
new file mode 100644
index 0000000000..28a272f84b
--- /dev/null
+++ b/package/dnsmasq/patches/103-ipv6_fix.patch
@@ -0,0 +1,44 @@
+--- a/src/netlink.c
++++ b/src/netlink.c
+@@ -116,6 +116,7 @@
+ ssize_t len;
+ static unsigned int seq = 0;
+ int family = AF_INET;
++ int ipv4_done = 0;
+
+ struct {
+ struct nlmsghdr nlh;
+@@ -187,9 +188,12 @@
+ rta = RTA_NEXT(rta, len1);
+ }
+
+- if (addr.s_addr && ipv4_callback)
++ if (addr.s_addr && ipv4_callback) {
+ if (!((*ipv4_callback)(addr, ifa->ifa_index, netmask, broadcast, parm)))
+ return 0;
++ else
++ ipv4_done = 1;
++ }
+ }
+ #ifdef HAVE_IPV6
+ else if (ifa->ifa_family == AF_INET6)
+@@ -205,7 +209,7 @@
+
+ if (addrp && ipv6_callback)
+ if (!((*ipv6_callback)(addrp, ifa->ifa_index, ifa->ifa_index, parm)))
+- return 0;
++ return ipv4_done;
+ }
+ #endif
+ }
+--- a/src/network.c
++++ b/src/network.c
+@@ -278,7 +278,7 @@
+ bind(tcpfd, (struct sockaddr *)&addr, sa_len(&addr)) == -1 ||
+ listen(tcpfd, 5) == -1 ||
+ bind(fd, (struct sockaddr *)&addr, sa_len(&addr)) == -1)
+- return 0;
++ return 1;
+
+ l = safe_malloc(sizeof(struct listener));
+ l->fd = fd;