Browse Source

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
OPENBSD_4_5
claudio 16 years ago
parent
commit
e4276bb410
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/ntp.c

+ 2
- 2
src/usr.sbin/ntpd/ntp.c View File

@ -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 <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -344,7 +344,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf, struct passwd *pw)
sensor_hotplugevent(hotplugfd); 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)) { if (pfd[j].revents & (POLLIN|POLLERR)) {
nfds--; nfds--;
if (server_dispatch(pfd[j].fd, conf) == -1) if (server_dispatch(pfd[j].fd, conf) == -1)


Loading…
Cancel
Save