"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/forward.c" between
dnsmasq-2.83.tar.xz and dnsmasq-2.84.tar.xz

About: Dnsmasq is a lightweight caching DNS forwarder and DHCP server.

forward.c  (dnsmasq-2.83.tar.xz):forward.c  (dnsmasq-2.84.tar.xz)
/* dnsmasq is Copyright (c) 2000-2020 Simon Kelley /* dnsmasq is Copyright (c) 2000-2021 Simon Kelley
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991, or the Free Software Foundation; version 2 dated June, 1991, or
(at your option) version 3 dated 29 June, 2007. (at your option) version 3 dated 29 June, 2007.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
skipping to change at line 380 skipping to change at line 380
{ {
struct frec_src *new = daemon->free_frec_src; struct frec_src *new = daemon->free_frec_src;
daemon->free_frec_src = new->next; daemon->free_frec_src = new->next;
new->next = forward->frec_src.next; new->next = forward->frec_src.next;
forward->frec_src.next = new; forward->frec_src.next = new;
new->orig_id = ntohs(header->id); new->orig_id = ntohs(header->id);
new->source = *udpaddr; new->source = *udpaddr;
new->dest = *dst_addr; new->dest = *dst_addr;
new->log_id = daemon->log_id; new->log_id = daemon->log_id;
new->iface = dst_iface; new->iface = dst_iface;
new->fd = udpfd;
} }
return 1; return 1;
} }
if (gotname) if (gotname)
flags = search_servers(now, &addrp, gotname, daemon->namebuff, &type, &do main, &norebind); flags = search_servers(now, &addrp, gotname, daemon->namebuff, &type, &do main, &norebind);
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
do_dnssec = type & SERV_DO_DNSSEC; do_dnssec = type & SERV_DO_DNSSEC;
skipping to change at line 404 skipping to change at line 405
forward = get_new_frec(now, NULL, NULL); forward = get_new_frec(now, NULL, NULL);
/* table full - flags == 0, return REFUSED */ /* table full - flags == 0, return REFUSED */
if (forward) if (forward)
{ {
forward->frec_src.source = *udpaddr; forward->frec_src.source = *udpaddr;
forward->frec_src.orig_id = ntohs(header->id); forward->frec_src.orig_id = ntohs(header->id);
forward->frec_src.dest = *dst_addr; forward->frec_src.dest = *dst_addr;
forward->frec_src.iface = dst_iface; forward->frec_src.iface = dst_iface;
forward->frec_src.next = NULL; forward->frec_src.next = NULL;
forward->frec_src.fd = udpfd;
forward->new_id = get_id(); forward->new_id = get_id();
forward->fd = udpfd;
memcpy(forward->hash, hash, HASH_SIZE); memcpy(forward->hash, hash, HASH_SIZE);
forward->forwardall = 0; forward->forwardall = 0;
forward->flags = fwd_flags; forward->flags = fwd_flags;
if (norebind) if (norebind)
forward->flags |= FREC_NOREBIND; forward->flags |= FREC_NOREBIND;
if (header->hb4 & HB4_CD) if (header->hb4 & HB4_CD)
forward->flags |= FREC_CHECKING_DISABLED; forward->flags |= FREC_CHECKING_DISABLED;
if (ad_reqd) if (ad_reqd)
forward->flags |= FREC_AD_QUESTION; forward->flags |= FREC_AD_QUESTION;
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
skipping to change at line 1299 skipping to change at line 1300
#endif #endif
for (src = &forward->frec_src; src; src = src->next) for (src = &forward->frec_src; src; src = src->next)
{ {
header->id = htons(src->orig_id); header->id = htons(src->orig_id);
#ifdef HAVE_DUMPFILE #ifdef HAVE_DUMPFILE
dump_packet(DUMP_REPLY, daemon->packet, (size_t)nn, NULL, &src->sou rce); dump_packet(DUMP_REPLY, daemon->packet, (size_t)nn, NULL, &src->sou rce);
#endif #endif
send_from(forward->fd, option_bool(OPT_NOWILD) || option_bool (OPT_ CLEVERBIND), daemon->packet, nn, send_from(src->fd, option_bool(OPT_NOWILD) || option_bool (OPT_CLEV ERBIND), daemon->packet, nn,
&src->source, &src->dest, src->iface); &src->source, &src->dest, src->iface);
if (option_bool(OPT_EXTRALOG) && src != &forward->frec_src) if (option_bool(OPT_EXTRALOG) && src != &forward->frec_src)
{ {
daemon->log_display_id = src->log_id; daemon->log_display_id = src->log_id;
daemon->log_source_addr = &src->source; daemon->log_source_addr = &src->source;
log_query(F_UPSTREAM, "query", NULL, "duplicate"); log_query(F_UPSTREAM, "query", NULL, "duplicate");
} }
} }
} }
 End of changes. 5 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)