|
|
@ -1,4 +1,4 @@ |
|
|
|
/* $OpenBSD: client.c,v 1.112 2019/11/10 19:24:47 otto Exp $ */ |
|
|
|
/* $OpenBSD: client.c,v 1.113 2020/01/30 15:55:41 otto Exp $ */ |
|
|
|
|
|
|
|
/* |
|
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
|
@ -324,12 +324,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (T4 < JAN_1970) { |
|
|
|
client_log_error(p, "recvmsg control format", EBADF); |
|
|
|
set_next(p, error_interval()); |
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|
ntp_getmsg((struct sockaddr *)&p->addr->ss, buf, size, &msg); |
|
|
|
|
|
|
|
if (msg.orgtime.int_partl != p->query->msg.xmttime.int_partl || |
|
|
@ -375,16 +369,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic) |
|
|
|
T2 = lfp_to_d(msg.rectime); |
|
|
|
T3 = lfp_to_d(msg.xmttime); |
|
|
|
|
|
|
|
/* |
|
|
|
* XXX workaround: time_t / tv_sec must never wrap. |
|
|
|
* around 2020 we will need a solution (64bit time_t / tv_sec). |
|
|
|
* consider every answer with a timestamp beyond january 2030 bogus. |
|
|
|
*/ |
|
|
|
if (T2 > JAN_2030 || T3 > JAN_2030) { |
|
|
|
set_next(p, error_interval()); |
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|
/* Detect liars */ |
|
|
|
if (!p->trusted && conf->constraint_median != 0 && |
|
|
|
(constraint_check(T2) != 0 || constraint_check(T3) != 0)) { |
|
|
|