Browse Source

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@
OPENBSD_5_7
bcook 9 years ago
parent
commit
dbf887d834
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      src/usr.sbin/ntpd/ntp_dns.c
  2. +3
    -3
      src/usr.sbin/ntpd/ntpd.c

+ 3
- 3
src/usr.sbin/ntpd/ntp_dns.c View File

@ -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> * Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
@ -167,12 +167,12 @@ dns_dispatch_imsg(void)
buf = NULL; buf = NULL;
break; break;
} }
if (buf)
imsg_close(ibuf_dns, buf);
} }
host_dns_free(hn); host_dns_free(hn);
hn = NULL; hn = NULL;
} }
if (buf)
imsg_close(ibuf_dns, buf);
break; break;
default: default:
break; break;


+ 3
- 3
src/usr.sbin/ntpd/ntpd.c View File

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -366,12 +366,12 @@ dispatch_imsg(struct ntpd_conf *lconf)
buf = NULL; buf = NULL;
break; break;
} }
if (buf)
imsg_close(ibuf, buf);
} }
host_dns_free(hn); host_dns_free(hn);
hn = NULL; hn = NULL;
} }
if (buf)
imsg_close(ibuf, buf);
break; break;
default: default:
break; break;


Loading…
Cancel
Save