98db6da3 |
1 | /* |
2 | * setup.c |
3 | * - configuration file parsing |
4 | * - management of global state |
5 | */ |
6 | /* |
3ff64957 |
7 | * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson |
98db6da3 |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2, or (at your option) |
12 | * any later version. |
13 | * |
14 | * This program is distributed in the hope that it will be useful, |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | * GNU General Public License for more details. |
18 | * |
19 | * You should have received a copy of the GNU General Public License |
20 | * along with this program; if not, write to the Free Software Foundation, |
21 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
22 | */ |
6f17710a |
23 | |
d05cc330 |
24 | #include <stdlib.h> |
25 | #include <errno.h> |
26 | #include <string.h> |
7ca1d685 |
27 | #include <limits.h> |
d05cc330 |
28 | #include <unistd.h> |
29 | #include <fcntl.h> |
6f17710a |
30 | |
d05cc330 |
31 | #include <netdb.h> |
763d28b9 |
32 | #include <sys/socket.h> |
33 | #include <netinet/in.h> |
d05cc330 |
34 | #include <arpa/inet.h> |
35 | |
36 | #include "internal.h" |
37 | |
d6b271ae |
38 | static void readconfig(adns_state ads, const char *filename); |
39 | |
6f17710a |
40 | static void addserver(adns_state ads, struct in_addr addr) { |
41 | int i; |
42 | struct server *ss; |
43 | |
44 | for (i=0; i<ads->nservers; i++) { |
45 | if (ads->servers[i].addr.s_addr == addr.s_addr) { |
11c8bf9b |
46 | adns__debug(ads,-1,0,"duplicate nameserver %s ignored",inet_ntoa(addr)); |
6f17710a |
47 | return; |
48 | } |
49 | } |
50 | |
51 | if (ads->nservers>=MAXSERVERS) { |
11c8bf9b |
52 | adns__diag(ads,-1,0,"too many nameservers, ignoring %s",inet_ntoa(addr)); |
6f17710a |
53 | return; |
54 | } |
55 | |
56 | ss= ads->servers+ads->nservers; |
57 | ss->addr= addr; |
6f17710a |
58 | ads->nservers++; |
59 | } |
60 | |
d6b271ae |
61 | static void saveerr(adns_state ads, int en) { |
62 | if (!ads->configerrno) ads->configerrno= en; |
63 | } |
64 | |
6f17710a |
65 | static void configparseerr(adns_state ads, const char *fn, int lno, |
66 | const char *fmt, ...) { |
67 | va_list al; |
d6b271ae |
68 | |
69 | saveerr(ads,EINVAL); |
70 | if (!ads->diagfile || (ads->iflags & adns_if_noerrprint)) return; |
71 | |
72 | if (lno==-1) fprintf(ads->diagfile,"adns: %s: ",fn); |
73 | else fprintf(ads->diagfile,"adns: %s:%d: ",fn,lno); |
6f17710a |
74 | va_start(al,fmt); |
d6b271ae |
75 | vfprintf(ads->diagfile,fmt,al); |
6f17710a |
76 | va_end(al); |
d6b271ae |
77 | fputc('\n',ads->diagfile); |
6f17710a |
78 | } |
79 | |
11f553d9 |
80 | static int nextword(const char **bufp_io, const char **word_r, int *l_r) { |
81 | const char *p, *q; |
82 | |
83 | p= *bufp_io; |
84 | while (ctype_whitespace(*p)) p++; |
85 | if (!*p) return 0; |
86 | |
87 | q= p; |
88 | while (*q && !ctype_whitespace(*q)) q++; |
89 | |
90 | *l_r= q-p; |
91 | *word_r= p; |
92 | *bufp_io= q; |
93 | |
94 | return 1; |
95 | } |
96 | |
6f17710a |
97 | static void ccf_nameserver(adns_state ads, const char *fn, int lno, const char *buf) { |
98 | struct in_addr ia; |
99 | |
100 | if (!inet_aton(buf,&ia)) { |
101 | configparseerr(ads,fn,lno,"invalid nameserver address `%s'",buf); |
102 | return; |
103 | } |
11c8bf9b |
104 | adns__debug(ads,-1,0,"using nameserver %s",inet_ntoa(ia)); |
6f17710a |
105 | addserver(ads,ia); |
106 | } |
107 | |
108 | static void ccf_search(adns_state ads, const char *fn, int lno, const char *buf) { |
11f553d9 |
109 | const char *bufp, *word; |
110 | char *newchars, **newptrs, **pp; |
111 | int count, tl, l; |
112 | |
6f17710a |
113 | if (!buf) return; |
11f553d9 |
114 | |
115 | bufp= buf; |
116 | count= 0; |
117 | tl= 0; |
118 | while (nextword(&bufp,&word,&l)) { count++; tl += l+1; } |
119 | |
120 | newptrs= malloc(sizeof(char*)*count); if (!newptrs) { saveerr(ads,errno); return; } |
121 | newchars= malloc(tl); if (!newchars) { saveerr(ads,errno); free(newptrs); return; } |
122 | |
123 | bufp= buf; |
124 | pp= newptrs; |
125 | while (nextword(&bufp,&word,&l)) { |
126 | *pp++= newchars; |
127 | memcpy(newchars,word,l); |
128 | newchars += l; |
129 | *newchars++ = 0; |
130 | } |
131 | |
132 | free(ads->searchlist); |
133 | ads->nsearchlist= count; |
134 | ads->searchlist= newptrs; |
6f17710a |
135 | } |
136 | |
11f553d9 |
137 | static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *buf) { |
138 | const char *word; |
8c3aa944 |
139 | char tbuf[200], *slash, *ep; |
140 | struct in_addr base, mask; |
141 | int l; |
142 | unsigned long initial, baselocal; |
143 | |
11f553d9 |
144 | if (!buf) return; |
145 | |
8c3aa944 |
146 | ads->nsortlist= 0; |
11f553d9 |
147 | while (nextword(&buf,&word,&l)) { |
8c3aa944 |
148 | if (ads->nsortlist >= MAXSORTLIST) { |
11f553d9 |
149 | adns__diag(ads,-1,0,"too many sortlist entries, ignoring %.*s onwards",l,word); |
8c3aa944 |
150 | return; |
151 | } |
152 | |
153 | if (l >= sizeof(tbuf)) { |
11f553d9 |
154 | configparseerr(ads,fn,lno,"sortlist entry `%.*s' too long",l,word); |
8c3aa944 |
155 | continue; |
156 | } |
157 | |
7ca1d685 |
158 | memcpy(tbuf,word,l); tbuf[l]= 0; |
8c3aa944 |
159 | slash= strchr(tbuf,'/'); |
160 | if (slash) *slash++= 0; |
161 | |
162 | if (!inet_aton(tbuf,&base)) { |
163 | configparseerr(ads,fn,lno,"invalid address `%s' in sortlist",tbuf); |
164 | continue; |
165 | } |
166 | |
167 | if (slash) { |
168 | if (strchr(slash,'.')) { |
169 | if (!inet_aton(slash,&mask)) { |
170 | configparseerr(ads,fn,lno,"invalid mask `%s' in sortlist",slash); |
171 | continue; |
172 | } |
173 | if (base.s_addr & ~mask.s_addr) { |
174 | configparseerr(ads,fn,lno, |
175 | "mask `%s' in sortlist overlaps address `%s'",slash,tbuf); |
176 | continue; |
177 | } |
178 | } else { |
179 | initial= strtoul(slash,&ep,10); |
180 | if (*ep || initial>32) { |
181 | configparseerr(ads,fn,lno,"mask length `%s' invalid",slash); |
182 | continue; |
183 | } |
184 | mask.s_addr= htonl((0x0ffffffffUL) << (32-initial)); |
185 | } |
186 | } else { |
187 | baselocal= ntohl(base.s_addr); |
188 | if (!baselocal & 0x080000000UL) /* class A */ |
189 | mask.s_addr= htonl(0x0ff000000UL); |
190 | else if ((baselocal & 0x0c0000000UL) == 0x080000000UL) |
191 | mask.s_addr= htonl(0x0ffff0000UL); /* class B */ |
192 | else if ((baselocal & 0x0f0000000UL) == 0x0e0000000UL) |
193 | mask.s_addr= htonl(0x0ff000000UL); /* class C */ |
194 | else { |
195 | configparseerr(ads,fn,lno, |
196 | "network address `%s' in sortlist is not in classed ranges," |
197 | " must specify mask explicitly", tbuf); |
198 | continue; |
199 | } |
200 | } |
201 | |
202 | ads->sortlist[ads->nsortlist].base= base; |
203 | ads->sortlist[ads->nsortlist].mask= mask; |
204 | ads->nsortlist++; |
205 | } |
6f17710a |
206 | } |
207 | |
208 | static void ccf_options(adns_state ads, const char *fn, int lno, const char *buf) { |
7ca1d685 |
209 | const char *word; |
210 | char *ep; |
211 | unsigned long v; |
212 | int l; |
213 | |
6f17710a |
214 | if (!buf) return; |
7ca1d685 |
215 | |
216 | while (nextword(&buf,&word,&l)) { |
217 | if (l==5 && !memcmp(word,"debug",5)) { |
218 | ads->iflags |= adns_if_debug; |
219 | continue; |
220 | } |
221 | if (l>=6 && !memcmp(word,"ndots:",6)) { |
222 | v= strtoul(word+6,&ep,10); |
223 | if (l==6 || ep != word+l || v > INT_MAX) { |
224 | configparseerr(ads,fn,lno,"option `%.*s' malformed or has bad value",l,word); |
225 | continue; |
226 | } |
227 | ads->searchndots= v; |
228 | continue; |
229 | } |
230 | adns__diag(ads,-1,0,"%s:%d: unknown option `%.*s'", fn,lno, l,word); |
231 | } |
6f17710a |
232 | } |
233 | |
234 | static void ccf_clearnss(adns_state ads, const char *fn, int lno, const char *buf) { |
235 | ads->nservers= 0; |
236 | } |
237 | |
d6b271ae |
238 | static void ccf_include(adns_state ads, const char *fn, int lno, const char *buf) { |
239 | if (!*buf) { |
240 | configparseerr(ads,fn,lno,"`include' directive with no filename"); |
241 | return; |
242 | } |
243 | readconfig(ads,buf); |
244 | } |
245 | |
6f17710a |
246 | static const struct configcommandinfo { |
247 | const char *name; |
248 | void (*fn)(adns_state ads, const char *fn, int lno, const char *buf); |
249 | } configcommandinfos[]= { |
250 | { "nameserver", ccf_nameserver }, |
251 | { "domain", ccf_search }, |
252 | { "search", ccf_search }, |
253 | { "sortlist", ccf_sortlist }, |
254 | { "options", ccf_options }, |
255 | { "clearnameservers", ccf_clearnss }, |
d6b271ae |
256 | { "include", ccf_include }, |
6f17710a |
257 | { 0 } |
258 | }; |
259 | |
d6b271ae |
260 | typedef union { |
6f17710a |
261 | FILE *file; |
d6b271ae |
262 | const char *text; |
263 | } getline_ctx; |
6f17710a |
264 | |
d6b271ae |
265 | static int gl_file(adns_state ads, getline_ctx *src_io, const char *filename, |
266 | int lno, char *buf, int buflen) { |
267 | FILE *file= src_io->file; |
268 | int c, i; |
269 | char *p; |
270 | |
271 | p= buf; |
272 | buflen--; |
273 | i= 0; |
274 | |
275 | for (;;) { /* loop over chars */ |
276 | if (i == buflen) { |
277 | adns__diag(ads,-1,0,"%s:%d: line too long, ignored",filename,lno); |
278 | goto x_badline; |
279 | } |
280 | c= getc(file); |
281 | if (!c) { |
282 | adns__diag(ads,-1,0,"%s:%d: line contains nul, ignored",filename,lno); |
283 | goto x_badline; |
284 | } else if (c == '\n') { |
285 | break; |
286 | } else if (c == EOF) { |
287 | if (ferror(file)) { |
288 | saveerr(ads,errno); |
289 | adns__diag(ads,-1,0,"%s:%d: read error: %s",filename,lno,strerror(errno)); |
290 | return -1; |
291 | } |
292 | if (!i) return -1; |
293 | break; |
294 | } else { |
295 | *p++= c; |
296 | i++; |
6f17710a |
297 | } |
6f17710a |
298 | } |
299 | |
d6b271ae |
300 | *p++= 0; |
301 | return i; |
302 | |
303 | x_badline: |
304 | saveerr(ads,EINVAL); |
305 | while ((c= getc(file)) != EOF && c != '\n'); |
306 | return -2; |
307 | } |
308 | |
309 | static int gl_text(adns_state ads, getline_ctx *src_io, const char *filename, |
310 | int lno, char *buf, int buflen) { |
8c3aa944 |
311 | const char *cp= src_io->text; |
d6b271ae |
312 | int l; |
313 | |
8c3aa944 |
314 | if (!cp || !*cp) return -1; |
d6b271ae |
315 | |
8c3aa944 |
316 | if (*cp == ';' || *cp == '\n') cp++; |
317 | l= strcspn(cp,";\n"); |
318 | src_io->text = cp+l; |
d6b271ae |
319 | |
320 | if (l >= buflen) { |
321 | adns__diag(ads,-1,0,"%s:%d: line too long, ignored",filename,lno); |
322 | saveerr(ads,EINVAL); |
323 | return -2; |
324 | } |
325 | |
326 | memcpy(buf,cp,l); |
327 | buf[l]= 0; |
328 | return l; |
329 | } |
330 | |
331 | static void readconfiggeneric(adns_state ads, const char *filename, |
332 | int (*getline)(adns_state ads, getline_ctx*, |
333 | const char *filename, int lno, |
334 | char *buf, int buflen), |
335 | /* Returns >=0 for success, -1 for EOF or error |
336 | * (error will have been reported), or -2 for |
337 | * bad line was encountered, try again. |
338 | */ |
339 | getline_ctx gl_ctx) { |
340 | char linebuf[2000], *p, *q; |
341 | int lno, l, dirl; |
342 | const struct configcommandinfo *ccip; |
343 | |
344 | for (lno=1; |
345 | (l= getline(ads,&gl_ctx, filename,lno, linebuf,sizeof(linebuf))) != -1; |
346 | lno++) { |
347 | if (l == -2) continue; |
6f17710a |
348 | while (l>0 && ctype_whitespace(linebuf[l-1])) l--; |
349 | linebuf[l]= 0; |
350 | p= linebuf; |
351 | while (ctype_whitespace(*p)) p++; |
d6b271ae |
352 | if (*p == '#' || !*p) continue; |
6f17710a |
353 | q= p; |
354 | while (*q && !ctype_whitespace(*q)) q++; |
d6b271ae |
355 | dirl= q-p; |
6f17710a |
356 | for (ccip=configcommandinfos; |
d6b271ae |
357 | ccip->name && !(strlen(ccip->name)==dirl && !memcmp(ccip->name,p,q-p)); |
6f17710a |
358 | ccip++); |
359 | if (!ccip->name) { |
11c8bf9b |
360 | adns__diag(ads,-1,0,"%s:%d: unknown configuration directive `%.*s'", |
d05cc330 |
361 | filename,lno,q-p,p); |
6f17710a |
362 | continue; |
363 | } |
364 | while (ctype_whitespace(*q)) q++; |
365 | ccip->fn(ads,filename,lno,q); |
366 | } |
6f17710a |
367 | } |
368 | |
369 | static const char *instrum_getenv(adns_state ads, const char *envvar) { |
370 | const char *value; |
371 | |
372 | value= getenv(envvar); |
11c8bf9b |
373 | if (!value) adns__debug(ads,-1,0,"environment variable %s not set",envvar); |
374 | else adns__debug(ads,-1,0,"environment variable %s set to `%s'",envvar,value); |
6f17710a |
375 | return value; |
376 | } |
377 | |
d6b271ae |
378 | static void readconfig(adns_state ads, const char *filename) { |
379 | getline_ctx gl_ctx; |
380 | |
381 | gl_ctx.file= fopen(filename,"r"); |
382 | if (!gl_ctx.file) { |
383 | if (errno == ENOENT) { |
384 | adns__debug(ads,-1,0,"configuration file `%s' does not exist",filename); |
385 | return; |
386 | } |
387 | saveerr(ads,errno); |
388 | adns__diag(ads,-1,0,"cannot open configuration file `%s': %s", |
389 | filename,strerror(errno)); |
390 | return; |
391 | } |
392 | |
393 | readconfiggeneric(ads,filename,gl_file,gl_ctx); |
394 | |
395 | fclose(gl_ctx.file); |
396 | } |
397 | |
398 | static void readconfigtext(adns_state ads, const char *text, const char *showname) { |
399 | getline_ctx gl_ctx; |
400 | |
401 | gl_ctx.text= text; |
402 | readconfiggeneric(ads,showname,gl_text,gl_ctx); |
403 | } |
404 | |
6f17710a |
405 | static void readconfigenv(adns_state ads, const char *envvar) { |
406 | const char *filename; |
407 | |
408 | if (ads->iflags & adns_if_noenv) { |
11c8bf9b |
409 | adns__debug(ads,-1,0,"not checking environment variable `%s'",envvar); |
6f17710a |
410 | return; |
411 | } |
412 | filename= instrum_getenv(ads,envvar); |
413 | if (filename) readconfig(ads,filename); |
414 | } |
d05cc330 |
415 | |
8c3aa944 |
416 | static void readconfigenvtext(adns_state ads, const char *envvar) { |
417 | const char *textdata; |
418 | |
419 | if (ads->iflags & adns_if_noenv) { |
420 | adns__debug(ads,-1,0,"not checking environment variable `%s'",envvar); |
421 | return; |
422 | } |
423 | textdata= instrum_getenv(ads,envvar); |
424 | if (textdata) readconfigtext(ads,textdata,envvar); |
425 | } |
426 | |
d05cc330 |
427 | |
428 | int adns__setnonblock(adns_state ads, int fd) { |
429 | int r; |
6f17710a |
430 | |
d05cc330 |
431 | r= fcntl(fd,F_GETFL,0); if (r<0) return errno; |
432 | r |= O_NONBLOCK; |
433 | r= fcntl(fd,F_SETFL,r); if (r<0) return errno; |
434 | return 0; |
435 | } |
436 | |
d6b271ae |
437 | static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { |
6f17710a |
438 | adns_state ads; |
6f17710a |
439 | |
440 | ads= malloc(sizeof(*ads)); if (!ads) return errno; |
d6b271ae |
441 | |
6f17710a |
442 | ads->iflags= flags; |
d6b271ae |
443 | ads->diagfile= diagfile; |
d05cc330 |
444 | LIST_INIT(ads->timew); |
445 | LIST_INIT(ads->childw); |
446 | LIST_INIT(ads->output); |
447 | ads->nextid= 0x311f; |
448 | ads->udpsocket= ads->tcpsocket= -1; |
d05cc330 |
449 | adns__vbuf_init(&ads->tcpsend); |
450 | adns__vbuf_init(&ads->tcprecv); |
11f553d9 |
451 | ads->nservers= ads->nsortlist= ads->nsearchlist= ads->tcpserver= 0; |
d05cc330 |
452 | ads->tcpstate= server_disconnected; |
11f553d9 |
453 | ads->searchlist= 0; |
7e6a84a1 |
454 | ads->searchndots= 1; |
d05cc330 |
455 | timerclear(&ads->tcptimeout); |
6f17710a |
456 | |
d6b271ae |
457 | *ads_r= ads; |
458 | return 0; |
459 | } |
6f17710a |
460 | |
d6b271ae |
461 | static int init_finish(adns_state ads) { |
462 | struct in_addr ia; |
463 | struct protoent *proto; |
464 | int r; |
465 | |
6f17710a |
466 | if (!ads->nservers) { |
d6b271ae |
467 | if (ads->diagfile && ads->iflags & adns_if_debug) |
468 | fprintf(ads->diagfile,"adns: no nameservers, using localhost\n"); |
8c3aa944 |
469 | ia.s_addr= htonl(INADDR_LOOPBACK); |
6f17710a |
470 | addserver(ads,ia); |
471 | } |
472 | |
473 | proto= getprotobyname("udp"); if (!proto) { r= ENOPROTOOPT; goto x_free; } |
474 | ads->udpsocket= socket(AF_INET,SOCK_DGRAM,proto->p_proto); |
71324651 |
475 | if (ads->udpsocket<0) { r= errno; goto x_free; } |
48cb0b4b |
476 | |
de8b18da |
477 | r= adns__setnonblock(ads,ads->udpsocket); |
478 | if (r) { r= errno; goto x_closeudp; } |
6f17710a |
479 | |
6f17710a |
480 | return 0; |
481 | |
de8b18da |
482 | x_closeudp: |
483 | close(ads->udpsocket); |
6f17710a |
484 | x_free: |
485 | free(ads); |
486 | return r; |
487 | } |
488 | |
11f553d9 |
489 | static void init_abort(adns_state ads) { |
490 | if (ads->nsearchlist) { |
491 | free(ads->searchlist[0]); |
492 | free(ads->searchlist); |
493 | } |
494 | free(ads); |
495 | } |
496 | |
d6b271ae |
497 | int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { |
498 | adns_state ads; |
499 | const char *res_options, *adns_res_options; |
500 | int r; |
501 | |
502 | r= init_begin(&ads, flags, diagfile ? diagfile : stderr); |
503 | if (r) return r; |
504 | |
505 | res_options= instrum_getenv(ads,"RES_OPTIONS"); |
506 | adns_res_options= instrum_getenv(ads,"ADNS_RES_OPTIONS"); |
507 | ccf_options(ads,"RES_OPTIONS",-1,res_options); |
508 | ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options); |
509 | |
510 | readconfig(ads,"/etc/resolv.conf"); |
511 | readconfigenv(ads,"RES_CONF"); |
512 | readconfigenv(ads,"ADNS_RES_CONF"); |
513 | |
8c3aa944 |
514 | readconfigenvtext(ads,"RES_CONF_TEXT"); |
515 | readconfigenvtext(ads,"ADNS_RES_CONF_TEXT"); |
516 | |
d6b271ae |
517 | ccf_options(ads,"RES_OPTIONS",-1,res_options); |
518 | ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options); |
519 | |
520 | ccf_search(ads,"LOCALDOMAIN",-1,instrum_getenv(ads,"LOCALDOMAIN")); |
521 | ccf_search(ads,"ADNS_LOCALDOMAIN",-1,instrum_getenv(ads,"ADNS_LOCALDOMAIN")); |
522 | |
11f553d9 |
523 | if (ads->configerrno && ads->configerrno != EINVAL) { |
524 | r= ads->configerrno; |
525 | init_abort(ads); |
526 | return r; |
527 | } |
528 | |
d6b271ae |
529 | r= init_finish(ads); |
530 | if (r) return r; |
531 | |
532 | *ads_r= ads; |
533 | return 0; |
534 | } |
535 | |
536 | int adns_init_strcfg(adns_state *ads_r, adns_initflags flags, |
537 | FILE *diagfile, const char *configtext) { |
538 | adns_state ads; |
539 | int r; |
540 | |
541 | r= init_begin(&ads, flags, diagfile); if (r) return r; |
542 | |
543 | readconfigtext(ads,configtext,"<supplied configuration text>"); |
544 | if (ads->configerrno) { |
545 | r= ads->configerrno; |
11f553d9 |
546 | init_abort(ads); |
d6b271ae |
547 | return r; |
548 | } |
549 | |
550 | r= init_finish(ads); if (r) return r; |
551 | *ads_r= ads; |
552 | return 0; |
553 | } |
554 | |
61093792 |
555 | void adns_finish(adns_state ads) { |
556 | for (;;) { |
557 | if (ads->timew.head) adns_cancel(ads->timew.head); |
558 | else if (ads->childw.head) adns_cancel(ads->childw.head); |
559 | else if (ads->output.head) adns_cancel(ads->output.head); |
560 | else break; |
561 | } |
562 | close(ads->udpsocket); |
563 | if (ads->tcpsocket >= 0) close(ads->tcpsocket); |
564 | adns__vbuf_free(&ads->tcpsend); |
565 | adns__vbuf_free(&ads->tcprecv); |
566 | free(ads); |
6f17710a |
567 | } |