From e4276bb410fafc2041482186820e2b4c8c118ed8 Mon Sep 17 00:00:00 2001 From: claudio <> Date: Wed, 10 Dec 2008 09:03:30 +0000 Subject: [PATCH] Correctly skip the internal fd when checking the server sockets. Use PFD_MAX to start the for loop and not 1 which was correct long long time ago. OK otto@ found by Anirban Sinha ASinha(at)zeugmasystems.com --- src/usr.sbin/ntpd/ntp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 0da4c3d1..04bd4a21 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.108 2008/10/02 14:00:21 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.109 2008/12/10 09:03:30 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -344,7 +344,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf, struct passwd *pw) sensor_hotplugevent(hotplugfd); } - for (j = 1; nfds > 0 && j < idx_peers; j++) + for (j = PFD_MAX; nfds > 0 && j < idx_peers; j++) if (pfd[j].revents & (POLLIN|POLLERR)) { nfds--; if (server_dispatch(pfd[j].fd, conf) == -1)