From 609076da6a1c9eb19b4df39c499686114587091f Mon Sep 17 00:00:00 2001 From: reyk <> Date: Wed, 11 Feb 2015 03:16:57 +0000 Subject: [PATCH] Remove dead code (IMSG_HOST_DNS has been moved from the parent to ntp_dns some years ago). OK henning@ --- src/usr.sbin/ntpd/ntpd.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index 4d04c4b3..283a3086 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.91 2015/02/10 11:46:39 reyk Exp $ */ +/* $OpenBSD: ntpd.c,v 1.92 2015/02/11 03:16:57 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -295,11 +295,8 @@ int dispatch_imsg(struct ntpd_conf *lconf) { struct imsg imsg; - int n, cnt; + int n; double d; - char *name; - struct ntp_addr *h, *hn; - struct ibuf *buf; if ((n = imsg_read(ibuf)) == -1) return (-1); @@ -346,34 +343,6 @@ dispatch_imsg(struct ntpd_conf *lconf) lconf->settime = 0; timeout = INFTIM; break; - case IMSG_HOST_DNS: - name = imsg.data; - if (imsg.hdr.len < 1 + IMSG_HEADER_SIZE) - fatalx("invalid IMSG_HOST_DNS received"); - imsg.hdr.len -= 1 + IMSG_HEADER_SIZE; - if (name[imsg.hdr.len] != '\0' || - strlen(name) != imsg.hdr.len) - fatalx("invalid IMSG_HOST_DNS received"); - if ((cnt = host_dns(name, &hn)) == -1) - break; - buf = imsg_create(ibuf, IMSG_HOST_DNS, - imsg.hdr.peerid, 0, - cnt * sizeof(struct sockaddr_storage)); - if (cnt > 0) { - if (buf) { - for (h = hn; h != NULL; h = h->next) - if (imsg_add(buf, &h->ss, - sizeof(h->ss)) == -1) { - buf = NULL; - break; - } - } - host_dns_free(hn); - hn = NULL; - } - if (buf) - imsg_close(ibuf, buf); - break; default: break; }