diff options
author | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-21 03:14:11 +0000 |
---|---|---|
committer | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-21 03:14:11 +0000 |
commit | 6f720c21e44afd95c27888f229f6ddd0843895c5 (patch) | |
tree | 545f8ac93ef8a19f3ac9c98c5e630bc63cff36c5 | |
parent | 4e9a5c798405405d671db689d883f0cf985663e3 (diff) |
Fix deferred host DNS lookups.
If the network is unreachable when ntpd starts and host_dns fails, be sure
that we still close the HOST_DNS imsg.
Thanks to Paul de Weerd <weerd at weirdnet dot nl> for reporting this.
ok beck@
-rw-r--r-- | usr.sbin/ntpd/ntp_dns.c | 6 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ntpd/ntp_dns.c b/usr.sbin/ntpd/ntp_dns.c index 451b358965f..37dea75bbd2 100644 --- a/usr.sbin/ntpd/ntp_dns.c +++ b/usr.sbin/ntpd/ntp_dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp_dns.c,v 1.7 2015/01/13 02:28:56 bcook Exp $ */ +/* $OpenBSD: ntp_dns.c,v 1.8 2015/01/21 03:14:10 bcook Exp $ */ /* * Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org> @@ -167,12 +167,12 @@ dns_dispatch_imsg(void) buf = NULL; break; } - if (buf) - imsg_close(ibuf_dns, buf); } host_dns_free(hn); hn = NULL; } + if (buf) + imsg_close(ibuf_dns, buf); break; default: break; diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 6f85b14266d..c22e5b73272 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.87 2015/01/19 20:47:03 bcook Exp $ */ +/* $OpenBSD: ntpd.c,v 1.88 2015/01/21 03:14:10 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -366,12 +366,12 @@ dispatch_imsg(struct ntpd_conf *lconf) buf = NULL; break; } - if (buf) - imsg_close(ibuf, buf); } host_dns_free(hn); hn = NULL; } + if (buf) + imsg_close(ibuf, buf); break; default: break; |