Lines Matching refs:forward
206 HEADER *header, size_t plen, time_t now, struct frec *forward) in forward_query() argument
218 forward = NULL; in forward_query()
219 else if (forward || (forward = lookup_frec_by_sender(ntohs(header->id), udpaddr, crc))) in forward_query()
222 domain = forward->sentto->domain; in forward_query()
223 forward->sentto->failed_queries++; in forward_query()
226 forward->forwardall = 1; in forward_query()
229 type = forward->sentto->flags & SERV_TYPE; in forward_query()
230 if (!(start = forward->sentto->next)) in forward_query()
232 header->id = htons(forward->new_id); in forward_query()
239 if (!flags && !(forward = get_new_frec(now, NULL))) in forward_query()
243 if (forward) in forward_query()
249 forward->source = *udpaddr; in forward_query()
250 forward->dest = *dst_addr; in forward_query()
251 forward->iface = dst_iface; in forward_query()
252 forward->orig_id = ntohs(header->id); in forward_query()
253 forward->new_id = get_id(is_sign, forward->orig_id, crc); in forward_query()
254 forward->fd = udpfd; in forward_query()
255 forward->crc = crc; in forward_query()
256 forward->forwardall = 0; in forward_query()
257 header->id = htons(forward->new_id); in forward_query()
270 forward->forwardall = 1; in forward_query()
281 if (!flags && forward) in forward_query()
306 if (!forward->rfd6 && in forward_query()
307 !(forward->rfd6 = allocate_rfd(AF_INET6))) in forward_query()
309 daemon->rfd_save = forward->rfd6; in forward_query()
310 fd = forward->rfd6->fd; in forward_query()
315 if (!forward->rfd4 && in forward_query()
316 !(forward->rfd4 = allocate_rfd(AF_INET))) in forward_query()
318 daemon->rfd_save = forward->rfd4; in forward_query()
319 fd = forward->rfd4->fd; in forward_query()
360 forward->sentto = start; in forward_query()
361 if (!forward->forwardall) in forward_query()
363 forward->forwardall++; in forward_query()
378 header->id = htons(forward->orig_id); in forward_query()
379 free_frec(forward); /* cancel */ in forward_query()
477 struct frec *forward; in reply_query() local
503 !(forward = lookup_frec(ntohs(header->id), questions_crc(header, n, daemon->namebuff)))) in reply_query()
506 server = forward->sentto; in reply_query()
510 forward->forwardall == 0) in reply_query()
528 forward_query(-1, NULL, NULL, 0, header, nn, now, forward); in reply_query()
534 if ((forward->sentto->flags & SERV_TYPE) == 0) in reply_query()
559 if (forward->forwardall == 0 || --forward->forwardall == 1 || in reply_query()
564 header->id = htons(forward->orig_id); in reply_query()
566 send_from(forward->fd, daemon->options & OPT_NOWILD, daemon->packet, nn, in reply_query()
567 &forward->source, &forward->dest, forward->iface); in reply_query()
569 free_frec(forward); /* cancel */ in reply_query()