Hi,

I will like to report a bug in openntpd.

Steps to reproduce the problem:
1)make onpenntpd point to an invalid ntp server in the domain.
2)opnentpd respawns.

for example if your ip address is 172.25.96.123 / 255.255.255.0
make it point to an invalid ntp server 172.25.96.0 or even 172.25.96.00

you get the following error in syslog and opnntpd respawns:
(certain details are omitted from the log which are not relevant to the problem)

<CRITICAL> Mar 12 09:13:02 axis-00408cf4380f ntpd[24391]: fatal:
client_query connect: Permission denied
<CRITICAL> Mar 12 09:13:02 axis-00408cf4380f ntpd[24390]:
dispatch_imsg in main: pipe closed
<INFO > Mar 12 09:13:02 axis-00408cf4380f ntpd[24390]: Terminating

respawnd914: message repeated 10 times: [ Respawning “/usr/sbin/ntpd
-s -p /var/run/ntpd.pid -f /var/run/ntpd/ntpd.conf”.]



I will like to propose following fix for the problem

diff --git a/openntpd/client.c b/openntpd/client.c
index 0491ba6..b006a2f 100644
--- a/openntpd/client.c
+++ b/openntpd/client.c
@@ -138,7 +138,7 @@ client_query(struct ntp_peer *p)
                        fatal("client_query socket");
                if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) {
                        if (errno == ECONNREFUSED || errno == ENETUNREACH ||
-                           errno == EHOSTUNREACH) {
+                           errno == EPERM || errno == EACCES || errno == 
EHOSTUNREACH) {
                                client_nextaddr(p);
                                set_next(p, error_interval());
                                return (-1);


Thanks,
-- 
/Dhiraj

Reply via email to