summaryrefslogtreecommitdiffstats
path: root/lib/libc/asr/asr.c
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2013-05-27 17:31:01 +0000
committereric <eric@openbsd.org>2013-05-27 17:31:01 +0000
commit1ed934d0d08bf9c3f460e8740d169e7606f8702f (patch)
tree7a998af1cd409090f648bb8eda3c9a42717ba397 /lib/libc/asr/asr.c
parentNo need to build asr files anymore. (diff)
downloadwireguard-openbsd-1ed934d0d08bf9c3f460e8740d169e7606f8702f.tar.xz
wireguard-openbsd-1ed934d0d08bf9c3f460e8740d169e7606f8702f.zip
Add minimal support for _res setup and update.
Change res_init() to initialize the _res structure on first call, and udpate the global async context if changes were made by the user. All resolver functions now call res_init() internally. fixes issue spotted by otto@
Diffstat (limited to 'lib/libc/asr/asr.c')
-rw-r--r--lib/libc/asr/asr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 1aea2bd4e7c..a2025ec4af0 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.25 2013/04/30 12:02:39 eric Exp $ */
+/* $OpenBSD: asr.c,v 1.26 2013/05/27 17:31:01 eric Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -394,9 +394,9 @@ asr_ctx_free(struct asr_ctx *ac)
if (ac->ac_domain)
free(ac->ac_domain);
- for (i = 0; i < ac->ac_nscount; i++)
+ for (i = 0; i < ASR_MAXNS; i++)
free(ac->ac_ns[i]);
- for (i = 0; i < ac->ac_domcount; i++)
+ for (i = 0; i < ASR_MAXDOM; i++)
free(ac->ac_dom[i]);
free(ac);
@@ -632,7 +632,7 @@ pass0(char **tok, int n, struct asr_ctx *ac)
}
} else if (!strcmp(tok[0], "search")) {
/* resolv.conf says the last line wins */
- for (i = 0; i < ac->ac_domcount; i++)
+ for (i = 0; i < ASR_MAXDOM; i++)
free(ac->ac_dom[i]);
ac->ac_domcount = 0;
for (i = 1; i < n; i++)