summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2014-01-10 12:20:38 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2014-01-10 12:20:38 +0000
commit4f04476e3b25d4e25cbfef17f29abdedf2b56574 (patch)
treea7bebfd5cb021c39f1f37f473a14504e180f03af /src
parent1486a9c7f27fbeb2fa131ef3274e34fa1d7098f2 (diff)
downloaddnsmasq-4f04476e3b25d4e25cbfef17f29abdedf2b56574.tar.gz
Set AD bit for address replies from /etc/hosts &c
Diffstat (limited to 'src')
-rw-r--r--src/cache.c14
-rw-r--r--src/config.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cache.c b/src/cache.c
index 1ff783c..fbdcae7 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -692,7 +692,7 @@ static void add_hosts_cname(struct crec *target)
if (hostname_isequal(cache_get_name(target), a->target) &&
(crec = whine_malloc(sizeof(struct crec))))
{
- crec->flags = F_FORWARD | F_IMMORTAL | F_NAMEP | F_CONFIG | F_CNAME;
+ crec->flags = F_FORWARD | F_IMMORTAL | F_NAMEP | F_CONFIG | F_CNAME | F_DNSSECOK;
crec->name.namep = a->alias;
crec->addr.cname.target.cache = target;
crec->addr.cname.uid = target->uid;
@@ -829,14 +829,14 @@ static int read_hostsfile(char *filename, int index, int cache_size, struct crec
if (inet_pton(AF_INET, token, &addr) > 0)
{
- flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4;
+ flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4 | F_DNSSECOK;
addrlen = INADDRSZ;
domain_suffix = get_domain(addr.addr.addr4);
}
#ifdef HAVE_IPV6
else if (inet_pton(AF_INET6, token, &addr) > 0)
{
- flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6;
+ flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6 | F_DNSSECOK;
addrlen = IN6ADDRSZ;
domain_suffix = get_domain6(&addr.addr.addr6);
}
@@ -990,7 +990,7 @@ void cache_reload(void)
(cache = whine_malloc(sizeof(struct crec))))
{
cache->name.namep = nl->name;
- cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4 | F_NAMEP | F_CONFIG;
+ cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4 | F_NAMEP | F_CONFIG | F_DNSSECOK;
add_hosts_entry(cache, (struct all_addr *)&hr->addr, INADDRSZ, 0, (struct crec **)daemon->packet, revhashsz);
}
#ifdef HAVE_IPV6
@@ -998,7 +998,7 @@ void cache_reload(void)
(cache = whine_malloc(sizeof(struct crec))))
{
cache->name.namep = nl->name;
- cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6 | F_NAMEP | F_CONFIG;
+ cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6 | F_NAMEP | F_CONFIG | F_DNSSECOK;
add_hosts_entry(cache, (struct all_addr *)&hr->addr6, IN6ADDRSZ, 0, (struct crec **)daemon->packet, revhashsz);
}
#endif
@@ -1068,7 +1068,7 @@ static void add_dhcp_cname(struct crec *target, time_t ttd)
if (aliasc)
{
- aliasc->flags = F_FORWARD | F_NAMEP | F_DHCP | F_CNAME | F_CONFIG;
+ aliasc->flags = F_FORWARD | F_NAMEP | F_DHCP | F_CNAME | F_CONFIG | F_DNSSECOK;
if (ttd == 0)
aliasc->flags |= F_IMMORTAL;
else
@@ -1156,7 +1156,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
if (crec) /* malloc may fail */
{
- crec->flags = flags | F_NAMEP | F_DHCP | F_FORWARD;
+ crec->flags = flags | F_NAMEP | F_DHCP | F_FORWARD | F_DNSSECOK;
if (ttd == 0)
crec->flags |= F_IMMORTAL;
else
diff --git a/src/config.h b/src/config.h
index 80b154c..c9870d4 100644
--- a/src/config.h
+++ b/src/config.h
@@ -18,7 +18,7 @@
#define MAX_PROCS 20 /* max no children for TCP requests */
#define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
-#define KEYBLOCK_LEN 140 /* choose to mininise fragmentation when storing DNSSEC keys */
+#define KEYBLOCK_LEN 35 /* choose to mininise fragmentation when storing DNSSEC keys */
#define TIMEOUT 10 /* drop UDP queries after TIMEOUT seconds */
#define FORWARD_TEST 50 /* try all servers every 50 queries */
#define FORWARD_TIME 20 /* or 20 seconds */