summaryrefslogtreecommitdiff
path: root/lib/libc/asr
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2019-01-14 06:23:07 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2019-01-14 06:23:07 +0000
commit38d3ca624a5e6eb15077b0647de73810c67ba927 (patch)
treefb9ad1c01583a078d1a4adcb42bbeed2dd67c071 /lib/libc/asr
parent90039b9cc261286416188fdaffb0de63f325dbc1 (diff)
There are cases where a program doing dns requests wants to set the
Checking Disabled flag. Introduce a RES flag to do so. ok krw@ deraadt@ eric@
Diffstat (limited to 'lib/libc/asr')
-rw-r--r--lib/libc/asr/res_mkquery.c4
-rw-r--r--lib/libc/asr/res_send_async.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/asr/res_mkquery.c b/lib/libc/asr/res_mkquery.c
index d6800877279..658d09ba614 100644
--- a/lib/libc/asr/res_mkquery.c
+++ b/lib/libc/asr/res_mkquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_mkquery.c,v 1.11 2017/02/27 11:38:08 jca Exp $ */
+/* $OpenBSD: res_mkquery.c,v 1.12 2019/01/14 06:23:06 otto Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -60,6 +60,8 @@ res_mkquery(int op, const char *dname, int class, int type,
h.id = res_randomid();
if (ac->ac_options & RES_RECURSE)
h.flags |= RD_MASK;
+ if (ac->ac_options & RES_USE_CDFLAG)
+ h.flags |= CD_MASK;
h.qdcount = 1;
if (ac->ac_options & (RES_USE_EDNS0 | RES_USE_DNSSEC))
h.arcount = 1;
diff --git a/lib/libc/asr/res_send_async.c b/lib/libc/asr/res_send_async.c
index d0b4cb0e060..a03fe82318d 100644
--- a/lib/libc/asr/res_send_async.c
+++ b/lib/libc/asr/res_send_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send_async.c,v 1.36 2017/03/15 15:54:41 deraadt Exp $ */
+/* $OpenBSD: res_send_async.c,v 1.37 2019/01/14 06:23:06 otto Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -376,6 +376,8 @@ setup_query(struct asr_query *as, const char *name, const char *dom,
h.id = res_randomid();
if (as->as_ctx->ac_options & RES_RECURSE)
h.flags |= RD_MASK;
+ if (as->as_ctx->ac_options & RES_USE_CDFLAG)
+ h.flags |= CD_MASK;
h.qdcount = 1;
if (as->as_ctx->ac_options & (RES_USE_EDNS0 | RES_USE_DNSSEC))
h.arcount = 1;