"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cache.c" between
dnsmasq-2.81.tar.xz and dnsmasq-2.82.tar.xz

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

cache.c  (dnsmasq-2.81.tar.xz):cache.c  (dnsmasq-2.82.tar.xz)
skipping to change at line 473 skipping to change at line 473
cache_free(new_chain); cache_free(new_chain);
new_chain = tmp; new_chain = tmp;
} }
new_chain = NULL; new_chain = NULL;
insert_error = 0; insert_error = 0;
} }
struct crec *cache_insert(char *name, union all_addr *addr, unsigned short class , struct crec *cache_insert(char *name, union all_addr *addr, unsigned short class ,
time_t now, unsigned long ttl, unsigned int flags) time_t now, unsigned long ttl, unsigned int flags)
{ {
/* Don't log DNSSEC records here, done elsewhere */ #ifdef HAVE_DNSSEC
if (flags & (F_IPV4 | F_IPV6 | F_CNAME | F_SRV)) if (flags & (F_DNSKEY | F_DS))
{ {
/* The DNSSEC validation process works by getting needed records into the
cache, then retrying the validation until they are all in place.
This can be messed up by very short TTLs, and _really_ messed up by
zero TTLs, so we force the TTL to be at least long enough to do a valida
tion.
Ideally, we should use some kind of reference counting so that records a
re
locked until the validation that asked for them is complete, but this
is much easier, and just as effective. */
if (ttl < DNSSEC_MIN_TTL)
ttl = DNSSEC_MIN_TTL;
}
else
#endif
{
/* Don't log DNSSEC records here, done elsewhere */
log_query(flags | F_UPSTREAM, name, addr, NULL); log_query(flags | F_UPSTREAM, name, addr, NULL);
/* Don't mess with TTL for DNSSEC records. */
if (daemon->max_cache_ttl != 0 && daemon->max_cache_ttl < ttl) if (daemon->max_cache_ttl != 0 && daemon->max_cache_ttl < ttl)
ttl = daemon->max_cache_ttl; ttl = daemon->max_cache_ttl;
if (daemon->min_cache_ttl != 0 && daemon->min_cache_ttl > ttl) if (daemon->min_cache_ttl != 0 && daemon->min_cache_ttl > ttl)
ttl = daemon->min_cache_ttl; ttl = daemon->min_cache_ttl;
} }
return really_insert(name, addr, class, now, ttl, flags); return really_insert(name, addr, class, now, ttl, flags);
} }
static struct crec *really_insert(char *name, union all_addr *addr, unsigned sho rt class, static struct crec *really_insert(char *name, union all_addr *addr, unsigned sho rt class,
 End of changes. 3 change blocks. 
3 lines changed or deleted 18 lines changed or added

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