summaryrefslogtreecommitdiffstats
path: root/dns.c
diff options
context:
space:
mode:
authorManuel Mausz <manuel@mausz.at>2026-06-25 14:11:15 +0200
committerManuel Mausz <manuel@mausz.at>2026-06-25 14:11:15 +0200
commit1bb24d70e0730ed35458d528ea266a267206f6d2 (patch)
tree7a5cae43f823856d35d0d147adddb7812f17a5c2 /dns.c
parentdc0a1c3474656cc7fbeadcdb9316a8a517ca7eb0 (diff)
downloadqmail-1bb24d70e0730ed35458d528ea266a267206f6d2.tar.gz
qmail-1bb24d70e0730ed35458d528ea266a267206f6d2.tar.bz2
qmail-1bb24d70e0730ed35458d528ea266a267206f6d2.zip
dns: use RES_USE_DNSSEC
Diffstat (limited to 'dns.c')
-rw-r--r--dns.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/dns.c b/dns.c
index ed35dda..16203c0 100644
--- a/dns.c
+++ b/dns.c
@@ -47,20 +47,23 @@ static int resolve(const stralloc *domain, int type)
47 47
48 if (!stralloc_copy(&glue,domain)) return DNS_MEM; 48 if (!stralloc_copy(&glue,domain)) return DNS_MEM;
49 if (!stralloc_0(&glue)) return DNS_MEM; 49 if (!stralloc_0(&glue)) return DNS_MEM;
50 if (!responsebuflen) 50 if (!responsebuflen) {
51 if (response.buf = (unsigned char *)alloc(PACKETSZ+1)) 51 if (response.buf = (unsigned char *)alloc(PACKETSZ+1))
52 responsebuflen = PACKETSZ+1; 52 responsebuflen = PACKETSZ+1;
53 else return DNS_MEM; 53 else return DNS_MEM;
54 }
54 55
55 dns_res_ad_flag = 0; 56 dns_res_ad_flag = 0;
57 dns_res_state.options |= RES_USE_DNSSEC;
56 responselen = lookup(&dns_res_state, glue.s, C_IN, type, response.buf, responsebuflen); 58 responselen = lookup(&dns_res_state, glue.s, C_IN, type, response.buf, responsebuflen);
57 if ((responselen >= responsebuflen) || 59 if ((responselen >= responsebuflen) ||
58 (responselen > 0 && (((HEADER *)response.buf)->tc))) 60 (responselen > 0 && (((HEADER *)response.buf)->tc)))
59 { 61 {
60 if (responsebuflen < 65536) 62 if (responsebuflen < 65536) {
61 if (alloc_re(&response.buf, responsebuflen, 65536)) 63 if (alloc_re(&response.buf, responsebuflen, 65536))
62 responsebuflen = 65536; 64 responsebuflen = 65536;
63 else return DNS_MEM; 65 else return DNS_MEM;
66 }
64 u_long saveresoptions = dns_res_state.options; 67 u_long saveresoptions = dns_res_state.options;
65 dns_res_state.options |= RES_USEVC; 68 dns_res_state.options |= RES_USEVC;
66 responselen = lookup(&dns_res_state, glue.s, C_IN, type, response.buf, responsebuflen); 69 responselen = lookup(&dns_res_state, glue.s, C_IN, type, response.buf, responsebuflen);
@@ -427,6 +430,10 @@ unsigned long random;
427 return flagsoft; 430 return flagsoft;
428} 431}
429 432
433#ifndef T_TLSA
434#define T_TLSA 52
435#endif
436
430int dns_tlsa(stralloc *out, const stralloc *fqdn) 437int dns_tlsa(stralloc *out, const stralloc *fqdn)
431{ 438{
432 int ranswers = 0; 439 int ranswers = 0;