X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fsetup.c;h=a0828703f8f55ddcc95c374a9f1b1cfd15844b15;hb=138722f000939e5a176b27d498c76681bdf04860;hp=3419cd6a5134f2157d710b541825ffa436d2ea36;hpb=64aae7c863f6e38cecc3cd6d5054f272e13852e8;p=adns.git diff --git a/src/setup.c b/src/setup.c index 3419cd6..a082870 100644 --- a/src/setup.c +++ b/src/setup.c @@ -264,7 +264,7 @@ static void ccf_options(adns_state ads, const char *fn, const char *word; char *ep; unsigned long v; - int l; + int i,l; if (!buf) return; @@ -298,6 +298,26 @@ static void ccf_options(adns_state ads, const char *fn, } continue; } + if (l>=8 && !memcmp(word,"adns_af:",8)) { + word += 8; + ads->iflags &= ~adns_if_afmask; + if (strcmp(word,"any")) for (;;) { + i= strcspn(word,","); + if (i>=4 && !memcmp(word,"ipv4",4)) + ads->iflags |= adns_if_permit_ipv4; + else if (i>=4 && !memcmp(word,"ipv6",4)) + ads->iflags |= adns_if_permit_ipv6; + else { + configparseerr(ads,fn,lno, "option adns_af has bad value `%.*s' " + "(must be `any' or list {`ipv4',`ipv6'},...)", + i, word); + break; + } + if (!word[i]) break; + word= word + i + 1; + } + continue; + } adns__diag(ads,-1,0,"%s:%d: unknown option `%.*s'", fn,lno, l,word); } } @@ -558,6 +578,7 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, LIST_INIT(ads->tcpw); LIST_INIT(ads->childw); LIST_INIT(ads->output); + LIST_INIT(ads->intdone); ads->forallnext= 0; ads->nextid= 0x311f; ads->nudp= 0; @@ -729,6 +750,7 @@ void adns_finish(adns_state ads) { else if (ads->tcpw.head) adns__cancel(ads->tcpw.head); else if (ads->childw.head) adns__cancel(ads->childw.head); else if (ads->output.head) adns__cancel(ads->output.head); + else if (ads->intdone.head) adns__cancel(ads->output.head); else break; } for (i=0; inudp; i++) close(ads->udpsocket[i].fd);