diff options
author | ckuethe <ckuethe@openbsd.org> | 2006-09-17 17:03:56 +0000 |
---|---|---|
committer | ckuethe <ckuethe@openbsd.org> | 2006-09-17 17:03:56 +0000 |
commit | 231a5ec47dcdd6da13a81f2da26cfff69f2ef904 (patch) | |
tree | 0e51676f5191866ae0429d1d69dcc71a3829710b /usr.sbin/rdate | |
parent | dont put two '\n' at the end of the string returnd by clnt_sperror() (diff) | |
download | wireguard-openbsd-231a5ec47dcdd6da13a81f2da26cfff69f2ef904.tar.xz wireguard-openbsd-231a5ec47dcdd6da13a81f2da26cfff69f2ef904.zip |
Make rdate ignore ntp responses with ALARM status.
"yeah..." henning@
Diffstat (limited to 'usr.sbin/rdate')
-rw-r--r-- | usr.sbin/rdate/ntp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c index 46b11f512a4..96c9c738ce6 100644 --- a/usr.sbin/rdate/ntp.c +++ b/usr.sbin/rdate/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.28 2006/03/14 22:56:20 deraadt Exp $ */ +/* $OpenBSD: ntp.c,v 1.29 2006/09/17 17:03:56 ckuethe Exp $ */ /* * Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved. @@ -241,6 +241,11 @@ sync_ntp(int fd, const struct sockaddr *peer, double *offset, double *error) return (-1); } + if ((data.status & STATUS_ALARM) == STATUS_ALARM) { + warnx("Ignoring NTP server with alarm flag set"); + return (-1); + } + if (*error <= minerr) break; } |