summaryrefslogtreecommitdiffstats
path: root/lib/libc/asr/asr.c
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2015-06-04 19:23:17 +0000
committereric <eric@openbsd.org>2015-06-04 19:23:17 +0000
commit5aaab1715958fdbbc4aa31fe3c5f3e342f748ed0 (patch)
tree16c588161107aca64c55870e8fd443a8e3306c62 /lib/libc/asr/asr.c
parentsync (diff)
downloadwireguard-openbsd-5aaab1715958fdbbc4aa31fe3c5f3e342f748ed0.tar.xz
wireguard-openbsd-5aaab1715958fdbbc4aa31fe3c5f3e342f748ed0.zip
make sure to check for resolv.conf update the first time the resolver
is used after pid has changed. ok deraadt@
Diffstat (limited to 'lib/libc/asr/asr.c')
-rw-r--r--lib/libc/asr/asr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 1d3e084dd3c..f0aef3dfb1a 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.37 2015/05/29 08:49:37 eric Exp $ */
+/* $OpenBSD: asr.c,v 1.38 2015/06/04 19:23:17 eric Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -412,12 +412,20 @@ asr_check_reload(struct asr *asr)
#if ASR_OPT_RELOADCONF
struct stat st;
struct timespec ts;
+ pid_t pid;
#endif
if (asr->a_path == NULL)
return;
#if ASR_OPT_RELOADCONF
+
+ pid = getpid();
+ if (pid != asr->a_pid) {
+ asr->a_pid = pid;
+ asr->a_rtime = 0;
+ }
+
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
return;