X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/7ef232c6c93693a8623c3cae0d00eade10354b89..f7e35411ca63bd2ed9596959e8258bd2caa1deb6:/src/setup.c diff --git a/src/setup.c b/src/setup.c index f49e722..0030dfb 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); } }