Lines Matching defs:addrinfo

134 	dns_adbaddrinfo_t *		addrinfo;
285 dns_adbaddrinfo_t *addrinfo;
316 dns_adbaddrinfo_t * addrinfo;
423 * Private addrinfo flags. These must not conflict with DNS_FETCHOPT_NOEDNS0,
424 * which we also use as an addrinfo flag.
458 static void add_bad(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
474 valcreate(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_name_t *name,
488 valarg->addrinfo = addrinfo;
770 dns_adbaddrinfo_t *addrinfo;
822 rtt = query->addrinfo->srtt + 200000;
830 dns_adb_adjustsrtt(fctx->adb, query->addrinfo, rtt, factor);
834 if (!TRIED(query->addrinfo)) {
835 dns_adb_changeflags(fctx->adb, query->addrinfo,
844 for (addrinfo = ISC_LIST_HEAD(fctx->forwaddrs);
845 addrinfo != NULL;
846 addrinfo = ISC_LIST_NEXT(addrinfo, publink))
847 if (UNMARKED(addrinfo))
848 dns_adb_adjustsrtt(fctx->adb, addrinfo,
855 for (addrinfo = ISC_LIST_HEAD(find->list);
856 addrinfo != NULL;
857 addrinfo = ISC_LIST_NEXT(addrinfo, publink))
858 if (UNMARKED(addrinfo))
859 dns_adb_adjustsrtt(fctx->adb, addrinfo,
863 for (addrinfo = ISC_LIST_HEAD(fctx->altaddrs);
864 addrinfo != NULL;
865 addrinfo = ISC_LIST_NEXT(addrinfo, publink))
866 if (UNMARKED(addrinfo))
867 dns_adb_adjustsrtt(fctx->adb, addrinfo,
872 for (addrinfo = ISC_LIST_HEAD(find->list);
873 addrinfo != NULL;
874 addrinfo = ISC_LIST_NEXT(addrinfo, publink))
875 if (UNMARKED(addrinfo))
876 dns_adb_adjustsrtt(fctx->adb, addrinfo,
1190 add_bad(fctx, query->addrinfo, sevent->result,
1311 fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
1327 srtt = addrinfo->srtt;
1328 if (ISFORWARDER(addrinfo) && srtt < 1000000)
1351 * Note that the caller MUST guarantee that 'addrinfo' will remain
1354 query->addrinfo = addrinfo;
1369 isc_netaddr_fromsockaddr(&dstip, &addrinfo->sockaddr);
1382 pf = isc_sockaddr_pf(&addrinfo->sockaddr);
1447 switch (isc_sockaddr_pf(&addrinfo->sockaddr)) {
1487 &addrinfo->sockaddr, task,
1502 if (isc_sockaddr_pf(&addrinfo->sockaddr) == PF_INET)
1674 &query->addrinfo->sockaddr,
1703 ISFORWARDER(query->addrinfo))
1748 isc_netaddr_fromsockaddr(&ipaddr, &query->addrinfo->sockaddr);
1755 if ((query->addrinfo->flags & DNS_FETCHOPT_NOEDNS0) == 0 &&
1761 dns_adb_changeflags(fctx->adb, query->addrinfo,
1766 /* Sync NOEDNS0 flag in addrinfo->flags and options now. */
1767 if ((query->addrinfo->flags & DNS_FETCHOPT_NOEDNS0) != 0)
1785 if ((triededns512(fctx, &query->addrinfo->sockaddr) ||
1790 } else if ((triededns(fctx, &query->addrinfo->sockaddr) ||
1805 if ((query->addrinfo->flags & DNS_FETCHOPT_NOEDNS0) == 0) {
1811 flags = query->addrinfo->flags;
1862 add_triededns(fctx, &query->addrinfo->sockaddr);
1865 add_triededns512(fctx, &query->addrinfo->sockaddr);
1932 address = &query->addrinfo->sockaddr;
2051 if (isc_sockaddr_pf(&query->addrinfo->sockaddr) ==
2204 dns_adbaddrinfo_t *addrinfo;
2218 for (addrinfo = ISC_LIST_HEAD(curr->list);
2219 addrinfo != NULL;
2220 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2221 if (bad_server(fctx, &addrinfo->sockaddr))
2222 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2231 for (addrinfo = ISC_LIST_HEAD(fctx->forwaddrs);
2232 addrinfo != NULL;
2233 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2234 if (bad_server(fctx, &addrinfo->sockaddr))
2235 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2246 for (addrinfo = ISC_LIST_HEAD(curr->list);
2247 addrinfo != NULL;
2248 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2249 if (bad_server(fctx, &addrinfo->sockaddr))
2250 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2256 for (addrinfo = ISC_LIST_HEAD(fctx->altaddrs);
2257 addrinfo != NULL;
2258 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2259 if (bad_server(fctx, &addrinfo->sockaddr))
2260 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2269 add_bad(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_result_t reason,
2280 isc_sockaddr_t *address = &addrinfo->sockaddr;
2317 ISFORWARDER(addrinfo))
2406 * Sort addrinfo list by RTT (with random jitter)
2443 dns_adbaddrinfo_t *addrinfo, *bestaddrinfo;
2445 /* Sort each find's addrinfo list by SRTT (after adding jitter) */
2459 addrinfo = ISC_LIST_HEAD(curr->list);
2460 INSIST(addrinfo != NULL);
2461 if (addrinfo->srtt < bestaddrinfo->srtt) {
2463 bestaddrinfo = addrinfo;
2905 dns_adbaddrinfo_t *addrinfo;
2915 for (addrinfo = ISC_LIST_HEAD(fctx->forwaddrs);
2916 addrinfo != NULL;
2917 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2918 if (!UNMARKED(addrinfo))
2920 possibly_mark(fctx, addrinfo);
2921 if (UNMARKED(addrinfo)) {
2922 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2924 return (addrinfo);
2944 * Find the first unmarked addrinfo.
2946 addrinfo = NULL;
2950 for (addrinfo = ISC_LIST_HEAD(find->list);
2951 addrinfo != NULL;
2952 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2953 if (!UNMARKED(addrinfo))
2955 possibly_mark(fctx, addrinfo);
2956 if (UNMARKED(addrinfo)) {
2957 addrinfo->flags |= FCTX_ADDRINFO_MARK;
2961 if (addrinfo != NULL)
2970 if (addrinfo != NULL)
2971 return (addrinfo);
2989 * Find the first unmarked addrinfo.
2991 addrinfo = NULL;
2995 for (addrinfo = ISC_LIST_HEAD(find->list);
2996 addrinfo != NULL;
2997 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
2998 if (!UNMARKED(addrinfo))
3000 possibly_mark(fctx, addrinfo);
3001 if (UNMARKED(addrinfo)) {
3002 addrinfo->flags |= FCTX_ADDRINFO_MARK;
3006 if (addrinfo != NULL)
3014 faddrinfo = addrinfo;
3020 for (addrinfo = ISC_LIST_HEAD(fctx->altaddrs);
3021 addrinfo != NULL;
3022 addrinfo = ISC_LIST_NEXT(addrinfo, publink)) {
3023 if (!UNMARKED(addrinfo))
3025 possibly_mark(fctx, addrinfo);
3026 if (UNMARKED(addrinfo) &&
3028 addrinfo->srtt < faddrinfo->srtt)) {
3031 addrinfo->flags |= FCTX_ADDRINFO_MARK;
3036 if (addrinfo == NULL) {
3037 addrinfo = faddrinfo;
3041 return (addrinfo);
3047 dns_adbaddrinfo_t *addrinfo;
3053 addrinfo = fctx_nextaddress(fctx);
3054 if (addrinfo == NULL) {
3079 addrinfo = fctx_nextaddress(fctx);
3084 if (addrinfo == NULL) {
3090 result = fctx_query(fctx, addrinfo, fctx->options);
3605 fctx->addrinfo = NULL;
3825 log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) {
3832 isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf));
3975 dns_adbaddrinfo_t *addrinfo;
4002 addrinfo = valarg->addrinfo;
4133 add_bad(fctx, addrinfo, result, badns_validation);
4507 cache_name(fetchctx_t *fctx, dns_name_t *name, dns_adbaddrinfo_t *addrinfo,
4791 result = valcreate(fctx, addrinfo,
4892 result = valcreate(fctx, addrinfo, name, fctx->type,
4921 cache_message(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_stdtime_t now)
4942 result = cache_name(fctx, name, addrinfo, now);
5016 ncache_message(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
5099 result = valcreate(fctx, addrinfo, name, fctx->type,
5508 else if (ISFORWARDER(fctx->addrinfo))
5570 else if (ISFORWARDER(fctx->addrinfo))
5604 else if (ISFORWARDER(fctx->addrinfo))
6361 isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf,
6458 dns_adbaddrinfo_t *addrinfo;
6473 if (isc_sockaddr_pf(&query->addrinfo->sockaddr) == PF_INET)
6495 fctx->addrinfo = query->addrinfo;
6519 add_bad_edns(fctx, &query->addrinfo->sockaddr);
6587 &query->addrinfo->sockaddr);
6611 add_bad_edns(fctx, &query->addrinfo->sockaddr);
6671 bad_edns(fctx, &query->addrinfo->sockaddr)) {
6673 isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf,
6675 dns_adb_changeflags(fctx->adb, query->addrinfo,
6754 add_bad_edns(fctx, &query->addrinfo->sockaddr);
6757 if (ISFORWARDER(query->addrinfo)) {
6795 dns_adb_changeflags(fctx->adb, query->addrinfo,
6828 if (fctx->res->lame_ttl != 0 && !ISFORWARDER(query->addrinfo) &&
6831 log_lame(fctx, query->addrinfo);
6832 result = dns_adb_marklame(fctx->adb, query->addrinfo,
6848 if (!ISFORWARDER(query->addrinfo) &&
6863 isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf,
6898 !ISFORWARDER(query->addrinfo))
6985 result = cache_message(fctx, query->addrinfo, now);
7004 result = ncache_message(fctx, query->addrinfo, covers, now);
7009 * Remember the query's addrinfo, in case we need to mark the
7012 addrinfo = query->addrinfo;
7029 add_bad(fctx, addrinfo, broken_server, broken_type);
7092 result = fctx_query(fctx, addrinfo, options);
7111 add_bad(fctx, addrinfo, result, broken_type);