summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rdate
diff options
context:
space:
mode:
authorckuethe <ckuethe@openbsd.org>2006-09-17 17:03:56 +0000
committerckuethe <ckuethe@openbsd.org>2006-09-17 17:03:56 +0000
commit231a5ec47dcdd6da13a81f2da26cfff69f2ef904 (patch)
tree0e51676f5191866ae0429d1d69dcc71a3829710b /usr.sbin/rdate
parentdont put two '\n' at the end of the string returnd by clnt_sperror() (diff)
downloadwireguard-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.c7
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;
}