1 |
commit: 0c73587753c8841c0cdd02d73150fe18b4d266f5 |
2 |
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun May 5 12:27:55 2019 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 6 15:28:59 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c735877 |
7 |
|
8 |
net-dns/djbdns: remove unused patch |
9 |
|
10 |
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com> |
11 |
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org> |
12 |
|
13 |
...e-similar-outgoing-queries-ipv6-test25-r1.patch | 351 --------------------- |
14 |
1 file changed, 351 deletions(-) |
15 |
|
16 |
diff --git a/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch b/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch |
17 |
deleted file mode 100644 |
18 |
index 1d132d6d4f5..00000000000 |
19 |
--- a/net-dns/djbdns/files/CVE2008-4392_0001-dnscache-merge-similar-outgoing-queries-ipv6-test25-r1.patch |
20 |
+++ /dev/null |
21 |
@@ -1,351 +0,0 @@ |
22 |
-diff --git a/Makefile b/Makefile |
23 |
-index 5ccd647..eee09dd 100644 |
24 |
---- a/Makefile |
25 |
-+++ b/Makefile |
26 |
-@@ -346,11 +346,11 @@ stralloc.h iopause.h taia.h tai.h uint64.h taia.h |
27 |
- ./compile dns_txt.c |
28 |
- |
29 |
- dnscache: \ |
30 |
--load dnscache.o droproot.o okclient.o log.o cache.o query.o \ |
31 |
-+load dnscache.o droproot.o okclient.o log.o cache.o query.o qmerge.o \ |
32 |
- response.o dd.o roots.o iopause.o prot.o dns.a env.a alloc.a buffer.a \ |
33 |
- libtai.a unix.a byte.a socket.lib |
34 |
- ./load dnscache droproot.o okclient.o log.o cache.o \ |
35 |
-- query.o response.o dd.o roots.o iopause.o prot.o dns.a \ |
36 |
-+ query.o qmerge.o response.o dd.o roots.o iopause.o prot.o dns.a \ |
37 |
- env.a alloc.a buffer.a libtai.a unix.a byte.a `cat \ |
38 |
- socket.lib` |
39 |
- |
40 |
-@@ -371,7 +371,7 @@ compile dnscache.c env.h exit.h scan.h strerr.h error.h ip4.h \ |
41 |
- uint16.h uint64.h socket.h uint16.h dns.h stralloc.h gen_alloc.h \ |
42 |
- iopause.h taia.h tai.h uint64.h taia.h taia.h byte.h roots.h fmt.h \ |
43 |
- iopause.h query.h dns.h uint32.h alloc.h response.h uint32.h cache.h \ |
44 |
--uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h |
45 |
-+uint32.h uint64.h ndelay.h log.h uint64.h okclient.h droproot.h maxclient.h |
46 |
- ./compile dnscache.c |
47 |
- |
48 |
- dnsfilter: \ |
49 |
-@@ -749,11 +749,16 @@ qlog.o: \ |
50 |
- compile qlog.c buffer.h qlog.h uint16.h |
51 |
- ./compile qlog.c |
52 |
- |
53 |
-+qmerge.o: \ |
54 |
-+compile qmerge.c qmerge.h dns.h stralloc.h gen_alloc.h iopause.h \ |
55 |
-+taia.h tai.h uint64.h log.h maxclient.h |
56 |
-+ ./compile qmerge.c |
57 |
-+ |
58 |
- query.o: \ |
59 |
- compile query.c error.h roots.h log.h uint64.h case.h cache.h \ |
60 |
- uint32.h uint64.h byte.h dns.h stralloc.h gen_alloc.h iopause.h \ |
61 |
- taia.h tai.h uint64.h taia.h uint64.h uint32.h uint16.h dd.h alloc.h \ |
62 |
--response.h uint32.h query.h dns.h uint32.h |
63 |
-+response.h uint32.h query.h dns.h uint32.h qmerge.h |
64 |
- ./compile query.c |
65 |
- |
66 |
- random-ip: \ |
67 |
-diff --git a/dnscache.c b/dnscache.c |
68 |
-index abcba69..c84e4b8 100644 |
69 |
---- a/dnscache.c |
70 |
-+++ b/dnscache.c |
71 |
-@@ -23,6 +23,7 @@ |
72 |
- #include "log.h" |
73 |
- #include "okclient.h" |
74 |
- #include "droproot.h" |
75 |
-+#include "maxclient.h" |
76 |
- |
77 |
- long interface; |
78 |
- |
79 |
-@@ -59,7 +60,6 @@ uint64 numqueries = 0; |
80 |
- |
81 |
- static int udp53; |
82 |
- |
83 |
--#define MAXUDP 200 |
84 |
- static struct udpclient { |
85 |
- struct query q; |
86 |
- struct taia start; |
87 |
-@@ -136,7 +136,6 @@ void u_new(void) |
88 |
- |
89 |
- static int tcp53; |
90 |
- |
91 |
--#define MAXTCP 20 |
92 |
- struct tcpclient { |
93 |
- struct query q; |
94 |
- struct taia start; |
95 |
-diff --git a/log.c b/log.c |
96 |
-index df465e2..1b0d98c 100644 |
97 |
---- a/log.c |
98 |
-+++ b/log.c |
99 |
-@@ -149,6 +149,13 @@ void log_tx(const char *q,const char qtype[2],const char *control,const char ser |
100 |
- line(); |
101 |
- } |
102 |
- |
103 |
-+void log_tx_piggyback(const char *q, const char qtype[2], const char *control) |
104 |
-+{ |
105 |
-+ string("txpb "); |
106 |
-+ logtype(qtype); space(); name(q); space(); name(control); |
107 |
-+ line(); |
108 |
-+} |
109 |
-+ |
110 |
- void log_cachedanswer(const char *q,const char type[2]) |
111 |
- { |
112 |
- string("cached "); logtype(type); space(); |
113 |
-diff --git a/log.h b/log.h |
114 |
-index fe62fa3..d9a829b 100644 |
115 |
---- a/log.h |
116 |
-+++ b/log.h |
117 |
-@@ -18,6 +18,7 @@ extern void log_cachednxdomain(const char *); |
118 |
- extern void log_cachedns(const char *,const char *); |
119 |
- |
120 |
- extern void log_tx(const char *,const char *,const char *,const char *,unsigned int); |
121 |
-+extern void log_tx_piggyback(const char *,const char *,const char *); |
122 |
- |
123 |
- extern void log_nxdomain(const char *,const char *,unsigned int); |
124 |
- extern void log_nodata(const char *,const char *,const char *,unsigned int); |
125 |
-diff --git a/maxclient.h b/maxclient.h |
126 |
-new file mode 100644 |
127 |
-index 0000000..e52fcd1 |
128 |
---- /dev/null |
129 |
-+++ b/maxclient.h |
130 |
-@@ -0,0 +1,7 @@ |
131 |
-+#ifndef MAXCLIENT_H |
132 |
-+#define MAXCLIENT_H |
133 |
-+ |
134 |
-+#define MAXUDP 200 |
135 |
-+#define MAXTCP 20 |
136 |
-+ |
137 |
-+#endif /* MAXCLIENT_H */ |
138 |
-diff --git a/qmerge.c b/qmerge.c |
139 |
-new file mode 100644 |
140 |
-index 0000000..7c92299 |
141 |
---- /dev/null |
142 |
-+++ b/qmerge.c |
143 |
-@@ -0,0 +1,115 @@ |
144 |
-+#include "qmerge.h" |
145 |
-+#include "byte.h" |
146 |
-+#include "log.h" |
147 |
-+#include "maxclient.h" |
148 |
-+ |
149 |
-+#define QMERGE_MAX (MAXUDP+MAXTCP) |
150 |
-+struct qmerge inprogress[QMERGE_MAX]; |
151 |
-+ |
152 |
-+static |
153 |
-+int qmerge_key_init(struct qmerge_key *qmk, const char *q, const char qtype[2], |
154 |
-+ const char *control) |
155 |
-+{ |
156 |
-+ if (!dns_domain_copy(&qmk->q, q)) return 0; |
157 |
-+ byte_copy(qmk->qtype, 2, qtype); |
158 |
-+ if (!dns_domain_copy(&qmk->control, control)) return 0; |
159 |
-+ return 1; |
160 |
-+} |
161 |
-+ |
162 |
-+static |
163 |
-+int qmerge_key_equal(struct qmerge_key *a, struct qmerge_key *b) |
164 |
-+{ |
165 |
-+ return |
166 |
-+ byte_equal(a->qtype, 2, b->qtype) && |
167 |
-+ dns_domain_equal(a->q, b->q) && |
168 |
-+ dns_domain_equal(a->control, b->control); |
169 |
-+} |
170 |
-+ |
171 |
-+static |
172 |
-+void qmerge_key_free(struct qmerge_key *qmk) |
173 |
-+{ |
174 |
-+ dns_domain_free(&qmk->q); |
175 |
-+ dns_domain_free(&qmk->control); |
176 |
-+} |
177 |
-+ |
178 |
-+void qmerge_free(struct qmerge **x) |
179 |
-+{ |
180 |
-+ struct qmerge *qm; |
181 |
-+ |
182 |
-+ qm = *x; |
183 |
-+ *x = 0; |
184 |
-+ if (!qm || !qm->active) return; |
185 |
-+ |
186 |
-+ qm->active--; |
187 |
-+ if (!qm->active) { |
188 |
-+ qmerge_key_free(&qm->key); |
189 |
-+ dns_transmit_free(&qm->dt); |
190 |
-+ } |
191 |
-+} |
192 |
-+ |
193 |
-+int qmerge_start(struct qmerge **qm, const char servers[64], int flagrecursive, |
194 |
-+ const char *q, const char qtype[2], const char localip[4], |
195 |
-+ const char *control) |
196 |
-+{ |
197 |
-+ struct qmerge_key k; |
198 |
-+ int i; |
199 |
-+ int r; |
200 |
-+ |
201 |
-+ qmerge_free(qm); |
202 |
-+ |
203 |
-+ byte_zero(&k, sizeof k); |
204 |
-+ if (!qmerge_key_init(&k, q, qtype, control)) return -1; |
205 |
-+ for (i = 0; i < QMERGE_MAX; i++) { |
206 |
-+ if (!inprogress[i].active) continue; |
207 |
-+ if (!qmerge_key_equal(&k, &inprogress[i].key)) continue; |
208 |
-+ log_tx_piggyback(q, qtype, control); |
209 |
-+ inprogress[i].active++; |
210 |
-+ *qm = &inprogress[i]; |
211 |
-+ qmerge_key_free(&k); |
212 |
-+ return 0; |
213 |
-+ } |
214 |
-+ |
215 |
-+ for (i = 0; i < QMERGE_MAX; i++) |
216 |
-+ if (!inprogress[i].active) |
217 |
-+ break; |
218 |
-+ if (i == QMERGE_MAX) return -1; |
219 |
-+ |
220 |
-+ log_tx(q, qtype, control, servers, 0); |
221 |
-+ r = dns_transmit_start(&inprogress[i].dt, servers, flagrecursive, q, qtype, localip); |
222 |
-+ if (r == -1) { qmerge_key_free(&k); return -1; } |
223 |
-+ inprogress[i].active++; |
224 |
-+ inprogress[i].state = 0; |
225 |
-+ qmerge_key_free(&inprogress[i].key); |
226 |
-+ byte_copy(&inprogress[i].key, sizeof k, &k); |
227 |
-+ *qm = &inprogress[i]; |
228 |
-+ return 0; |
229 |
-+} |
230 |
-+ |
231 |
-+void qmerge_io(struct qmerge *qm, iopause_fd *io, struct taia *deadline) |
232 |
-+{ |
233 |
-+ if (qm->state == 0) { |
234 |
-+ dns_transmit_io(&qm->dt, io, deadline); |
235 |
-+ qm->state = 1; |
236 |
-+ } |
237 |
-+ else { |
238 |
-+ io->fd = -1; |
239 |
-+ io->events = 0; |
240 |
-+ } |
241 |
-+} |
242 |
-+ |
243 |
-+int qmerge_get(struct qmerge **x, const iopause_fd *io, const struct taia *when) |
244 |
-+{ |
245 |
-+ int r; |
246 |
-+ struct qmerge *qm; |
247 |
-+ |
248 |
-+ qm = *x; |
249 |
-+ if (qm->state == -1) return -1; /* previous error */ |
250 |
-+ if (qm->state == 0) return 0; /* no packet */ |
251 |
-+ if (qm->state == 2) return 1; /* already got packet */ |
252 |
-+ |
253 |
-+ r = dns_transmit_get(&qm->dt, io, when); |
254 |
-+ if (r == -1) { qm->state = -1; return -1; } /* error */ |
255 |
-+ if (r == 0) { qm->state = 0; return 0; } /* must wait for i/o */ |
256 |
-+ if (r == 1) { qm->state = 2; return 1; } /* got packet */ |
257 |
-+ return -1; /* bug */ |
258 |
-+} |
259 |
-diff --git a/qmerge.h b/qmerge.h |
260 |
-new file mode 100644 |
261 |
-index 0000000..9a58157 |
262 |
---- /dev/null |
263 |
-+++ b/qmerge.h |
264 |
-@@ -0,0 +1,24 @@ |
265 |
-+#ifndef QMERGE_H |
266 |
-+#define QMERGE_H |
267 |
-+ |
268 |
-+#include "dns.h" |
269 |
-+ |
270 |
-+struct qmerge_key { |
271 |
-+ char *q; |
272 |
-+ char qtype[2]; |
273 |
-+ char *control; |
274 |
-+}; |
275 |
-+ |
276 |
-+struct qmerge { |
277 |
-+ int active; |
278 |
-+ struct qmerge_key key; |
279 |
-+ struct dns_transmit dt; |
280 |
-+ int state; /* -1 = error, 0 = need io, 1 = need get, 2 = got packet */ |
281 |
-+}; |
282 |
-+ |
283 |
-+extern int qmerge_start(struct qmerge **,const char *,int,const char *,const char *,const char *,const char *); |
284 |
-+extern void qmerge_io(struct qmerge *,iopause_fd *,struct taia *); |
285 |
-+extern int qmerge_get(struct qmerge **,const iopause_fd *,const struct taia *); |
286 |
-+extern void qmerge_free(struct qmerge **); |
287 |
-+ |
288 |
-+#endif /* QMERGE_H */ |
289 |
-diff --git a/query.c b/query.c |
290 |
-index d61b20c..d9be8b8 100644 |
291 |
---- a/query.c |
292 |
-+++ b/query.c |
293 |
-@@ -84,7 +84,7 @@ static void cleanup(struct query *z) |
294 |
- int j; |
295 |
- int k; |
296 |
- |
297 |
-- dns_transmit_free(&z->dt); |
298 |
-+ qmerge_free(&z->qm); |
299 |
- for (j = 0;j < QUERY_MAXALIAS;++j) |
300 |
- dns_domain_free(&z->alias[j]); |
301 |
- for (j = 0;j < QUERY_MAXLEVEL;++j) { |
302 |
-@@ -624,15 +624,9 @@ static int doit(struct query *z,int state) |
303 |
- if (j == 256) goto SERVFAIL; |
304 |
- |
305 |
- dns_sortip6(z->servers[z->level],256); |
306 |
-- if (z->level) { |
307 |
-- dtype = z->ipv6[z->level] ? DNS_T_AAAA : DNS_T_A; |
308 |
-- log_tx(z->name[z->level],dtype,z->control[z->level],z->servers[z->level],z->level); |
309 |
-- if (dns_transmit_start(&z->dt,z->servers[z->level],flagforwardonly,z->name[z->level],dtype,z->localip) == -1) goto DIE; |
310 |
-- } |
311 |
-- else { |
312 |
-- log_tx(z->name[0],z->type,z->control[0],z->servers[0],0); |
313 |
-- if (dns_transmit_start(&z->dt,z->servers[0],flagforwardonly,z->name[0],z->type,z->localip) == -1) goto DIE; |
314 |
-- } |
315 |
-+ dtype = z->level ? (z->ipv6[z->level] ? DNS_T_AAAA : DNS_T_A) : z->type; |
316 |
-+ if (qmerge_start(&z->qm,z->servers[z->level],flagforwardonly,z->name[z->level],dtype,z->localip,z->control[z->level]) == -1) goto DIE; |
317 |
-+ |
318 |
- return 0; |
319 |
- |
320 |
- |
321 |
-@@ -646,10 +640,10 @@ static int doit(struct query *z,int state) |
322 |
- |
323 |
- HAVEPACKET: |
324 |
- if (++z->loop == 200) goto DIE; |
325 |
-- buf = z->dt.packet; |
326 |
-- len = z->dt.packetlen; |
327 |
-+ buf = z->qm->dt.packet; |
328 |
-+ len = z->qm->dt.packetlen; |
329 |
- |
330 |
-- whichserver = z->dt.servers + 16 * z->dt.curserver; |
331 |
-+ whichserver = z->qm->dt.servers + 16 * z->qm->dt.curserver; |
332 |
- control = z->control[z->level]; |
333 |
- d = z->name[z->level]; |
334 |
- /* dtype = z->level ? DNS_T_A : z->type; */ |
335 |
-@@ -1071,7 +1065,7 @@ int query_start(struct query *z,char *dn,char type[2],char class[2],char localip |
336 |
- |
337 |
- int query_get(struct query *z,iopause_fd *x,struct taia *stamp) |
338 |
- { |
339 |
-- switch(dns_transmit_get(&z->dt,x,stamp)) { |
340 |
-+ switch(qmerge_get(&z->qm,x,stamp)) { |
341 |
- case 1: |
342 |
- return doit(z,1); |
343 |
- case -1: |
344 |
-@@ -1082,5 +1076,5 @@ int query_get(struct query *z,iopause_fd *x,struct taia *stamp) |
345 |
- |
346 |
- void query_io(struct query *z,iopause_fd *x,struct taia *deadline) |
347 |
- { |
348 |
-- dns_transmit_io(&z->dt,x,deadline); |
349 |
-+ qmerge_io(z->qm,x,deadline); |
350 |
- } |
351 |
-diff --git a/query.h b/query.h |
352 |
-index 61812aa..93a322e 100644 |
353 |
---- a/query.h |
354 |
-+++ b/query.h |
355 |
-@@ -1,7 +1,7 @@ |
356 |
- #ifndef QUERY_H |
357 |
- #define QUERY_H |
358 |
- |
359 |
--#include "dns.h" |
360 |
-+#include "qmerge.h" |
361 |
- #include "uint32.h" |
362 |
- |
363 |
- #define QUERY_MAXLEVEL 5 |
364 |
-@@ -22,7 +22,7 @@ struct query { |
365 |
- uint32 scope_id; |
366 |
- char type[2]; |
367 |
- char class[2]; |
368 |
-- struct dns_transmit dt; |
369 |
-+ struct qmerge *qm; |
370 |
- } ; |
371 |
- |
372 |
- extern int query_start(struct query *,char *,char *,char *,char *,unsigned int); |