]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/0013-Fix-breakage-of-domain-domain-subnet-local.patch
Merge remote-tracking branch 'stevee/core-90-geoip' into next
[ipfire-2.x.git] / src / patches / dnsmasq / 0013-Fix-breakage-of-domain-domain-subnet-local.patch
CommitLineData
6644c1c7
MT
1From 3ad3f3bbd4ee716a7d2fb1e115cf89bd1b1a5de9 Mon Sep 17 00:00:00 2001
2From: Simon Kelley <simon@thekelleys.org.uk>
3Date: Tue, 16 Dec 2014 18:25:17 +0000
d54a2ce4 4Subject: [PATCH 13/78] Fix breakage of --domain=<domain>,<subnet>,local
6644c1c7
MT
5
6---
7 CHANGELOG | 4 ++++
8 src/option.c | 18 ++++++++++++++++--
9 2 files changed, 20 insertions(+), 2 deletions(-)
10
11diff --git a/CHANGELOG b/CHANGELOG
12index 9174b0bd75dc..9e6c7aa4fd68 100644
13--- a/CHANGELOG
14+++ b/CHANGELOG
15@@ -10,6 +10,10 @@ version 2.73
16 Use inotify for checking on updates to /etc/resolv.conf and
17 friends under Linux. This fixes race conditions when the files are
18 updated rapidly and saves CPU by noy polling.
19+
20+ Fix breakage of --domain=<domain>,<subnet>,local - only reverse
21+ queries were intercepted. THis appears to have been broken
22+ since 2.69. Thanks to Josh Stone for finding the bug.
23
24
25 version 2.72
26diff --git a/src/option.c b/src/option.c
27index b08e98e16f84..209fa6976609 100644
28--- a/src/option.c
29+++ b/src/option.c
30@@ -1941,10 +1941,17 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
31 else
32 {
33 /* generate the equivalent of
34- local=/<domain>/
35 local=/xxx.yyy.zzz.in-addr.arpa/ */
36 struct server *serv = add_rev4(new->start, msize);
37 serv->flags |= SERV_NO_ADDR;
38+
39+ /* local=/<domain>/ */
40+ serv = opt_malloc(sizeof(struct server));
41+ memset(serv, 0, sizeof(struct server));
42+ serv->domain = d;
43+ serv->flags = SERV_HAS_DOMAIN | SERV_NO_ADDR;
44+ serv->next = daemon->servers;
45+ daemon->servers = serv;
46 }
47 }
48 }
49@@ -1978,10 +1985,17 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
50 else
51 {
52 /* generate the equivalent of
53- local=/<domain>/
54 local=/xxx.yyy.zzz.ip6.arpa/ */
55 struct server *serv = add_rev6(&new->start6, msize);
56 serv->flags |= SERV_NO_ADDR;
57+
58+ /* local=/<domain>/ */
59+ serv = opt_malloc(sizeof(struct server));
60+ memset(serv, 0, sizeof(struct server));
61+ serv->domain = d;
62+ serv->flags = SERV_HAS_DOMAIN | SERV_NO_ADDR;
63+ serv->next = daemon->servers;
64+ daemon->servers = serv;
65 }
66 }
67 }
68--
692.1.0
70