## page was renamed from djbdns/dnscache/query.c/referral ## page was renamed from DNS/実装/djbdns/dnscache/query.c/referral ## page was renamed from DNS/dnscache/query.c/referral DNS/dnscache/query.c/referralについて、ここに記述してください。 referral だと判断したら、authority section NSを抜きだし保存して、それらに対してqueryを送る。  (毒の可能性を考慮するならば、NSを問い合せ直すのがよい。) -- ToshinoriMaeno <> {{{ if (!dns_domain_suffix(d,referral)) goto DIE; control = d + dns_domain_suffixpos(d,referral); z->control[z->level] = control; byte_zero(z->servers[z->level],64); for (j = 0;j < QUERY_MAXNS;++j) dns_domain_free(&z->ns[z->level][j]); k = 0; pos = posauthority; for (j = 0;j < numauthority;++j) { pos = dns_packet_getname(buf,len,pos,&t1); if (!pos) goto DIE; pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; uint16_unpack_big(header + 8,&datalen); if (dns_domain_equal(referral,t1)) /* should always be true */ if (typematch(header,DNS_T_NS)) /* should always be true */ if (byte_equal(header + 2,2,DNS_C_IN)) /* should always be true */ if (k < QUERY_MAXNS) if (!dns_packet_getname(buf,len,pos,&z->ns[z->level][k++])) goto DIE; pos += datalen; } goto HAVENS; }}}