Browse Source

rebase patches

master
Brent Cook 4 years ago
parent
commit
c16617075b
15 changed files with 110 additions and 110 deletions
  1. +4
    -4
      patches/0001-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch
  2. +5
    -5
      patches/0002-EAI_NODATA-does-not-exist-everywhere.patch
  3. +4
    -4
      patches/0003-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch
  4. +6
    -6
      patches/0004-check-if-rdomain-support-is-available.patch
  5. +4
    -4
      patches/0005-update-ntpd.conf-to-indicate-OS-dependent-options.patch
  6. +4
    -4
      patches/0006-allow-overriding-default-user-and-file-locations.patch
  7. +34
    -34
      patches/0007-add-p-option-to-create-a-pid-file.patch
  8. +8
    -8
      patches/0008-initialize-setproctitle-where-needed.patch
  9. +9
    -9
      patches/0009-Notify-the-user-when-constraint-support-is-disabled.patch
  10. +5
    -5
      patches/0010-add-a-method-for-updating-the-realtime-clock-on-sync.patch
  11. +10
    -10
      patches/0011-Deal-with-missing-SO_TIMESTAMP.patch
  12. +5
    -5
      patches/0012-check-result-of-ftello-ftruncate.patch
  13. +2
    -2
      patches/0013-set-IPV6_V6ONLY-if-we-are-binding-to-an-IPv6-address.patch
  14. +4
    -4
      patches/0014-use-adjtimex-over-adjtime-check-return-value-and-adj.patch
  15. +6
    -6
      patches/0015-increase-buffer-sizes-potential-truncation.patch

+ 4
- 4
patches/0001-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch View File

@ -1,4 +1,4 @@
From 5ad3e4de4bedeeff0751b44a85032f48b9b6452c Mon Sep 17 00:00:00 2001
From 1bed0811fcc1b7ed35153ea78876d40a7f0ced0d Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:10:22 -0600
Subject: [PATCH 01/15] Handle IPv6 DNS records on IPv4 networks more liberally
@ -13,10 +13,10 @@ Original Author: Stefan Praszalowicz <stefan.praszalowicz@avedya.com>
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
index 3de52685b1..aa9fc24c68 100644
index d2e6119e23..98a1eb5825 100644
--- a/src/usr.sbin/ntpd/client.c
+++ b/src/usr.sbin/ntpd/client.c
@@ -140,9 +140,16 @@ client_query(struct ntp_peer *p)
@@ -153,9 +153,16 @@ client_query(struct ntp_peer *p)
struct sockaddr *qa4 = (struct sockaddr *)&p->query_addr4;
struct sockaddr *qa6 = (struct sockaddr *)&p->query_addr6;
@ -37,5 +37,5 @@ index 3de52685b1..aa9fc24c68 100644
if (p->addr->ss.ss_family == qa4->sa_family) {
if (bind(p->query->fd, qa4, SA_LEN(qa4)) == -1)
--
2.21.0
2.26.0

+ 5
- 5
patches/0002-EAI_NODATA-does-not-exist-everywhere.patch View File

@ -1,4 +1,4 @@
From e0650ecaa5c93e3ed002d18be2ed4bc701d54fb9 Mon Sep 17 00:00:00 2001
From bb77cb6ffa61b2c9fccba81ffb0c4c3cf252854b Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:04:08 -0600
Subject: [PATCH 02/15] EAI_NODATA does not exist everywhere
@ -15,12 +15,12 @@ portable software now has to have a special check instead.
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
index 25a92cf8ae..0208b8dfb4 100644
index 9472a4616f..224c913383 100644
--- a/src/usr.sbin/ntpd/config.c
+++ b/src/usr.sbin/ntpd/config.c
@@ -96,8 +96,14 @@ host_dns(const char *s, struct ntp_addr **hn)
@@ -98,8 +98,14 @@ host_dns1(const char *s, struct ntp_addr **hn, int notauth)
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
/* ntpd MUST NOT use AI_ADDRCONFIG here */
hints.ai_flags = AI_ADDRCONFIG;
error = getaddrinfo(s, NULL, &hints, &res0);
- if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME)
- return (0);
@ -36,5 +36,5 @@ index 25a92cf8ae..0208b8dfb4 100644
log_warnx("could not parse \"%s\": %s", s,
gai_strerror(error));
--
2.21.0
2.26.0

+ 4
- 4
patches/0003-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch View File

@ -1,4 +1,4 @@
From cf5f8571ae2d9855e351ab3add77814faccf560a Mon Sep 17 00:00:00 2001
From 21ac1d31562ea880952c655602060b537c77104e Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:02:50 -0600
Subject: [PATCH 03/15] conditionally fill in sin_len/sin6_len if they exist
@ -8,10 +8,10 @@ Subject: [PATCH 03/15] conditionally fill in sin_len/sin6_len if they exist
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y
index 6b436d55d4..34f07b68d2 100644
index 8d7ab09de3..fa84123903 100644
--- a/src/usr.sbin/ntpd/parse.y
+++ b/src/usr.sbin/ntpd/parse.y
@@ -138,15 +138,17 @@ main : LISTEN ON address listen_opts {
@@ -141,15 +141,17 @@ main : LISTEN ON address listen_opts {
memset(&sin4, 0, sizeof(sin4));
sin4.sin_family = AF_INET;
@ -33,5 +33,5 @@ index 6b436d55d4..34f07b68d2 100644
yyerror("invalid IPv4 or IPv6 address: %s\n",
$3);
--
2.21.0
2.26.0

+ 6
- 6
patches/0004-check-if-rdomain-support-is-available.patch View File

@ -1,4 +1,4 @@
From 94d6576454297079c35c3680b7c0aca413237ebe Mon Sep 17 00:00:00 2001
From 5fc49b081e877911de47a621cfd7ee536f08c613 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:05:46 -0600
Subject: [PATCH 04/15] check if rdomain support is available.
@ -12,10 +12,10 @@ Handle FreeBSD's calling rdomain 'FIB'.
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 91d1e0fb9b..d438a6576d 100644
index 208d19ccdf..05493ad1b2 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -40,6 +40,12 @@
@@ -41,6 +41,12 @@
#define DRIFTFILE "/var/db/ntpd.drift"
#define CTLSOCKET "/var/run/ntpd.sock"
@ -29,10 +29,10 @@ index 91d1e0fb9b..d438a6576d 100644
#define INTERVAL_QUERY_PATHETIC 60
#define INTERVAL_QUERY_AGGRESSIVE 5
diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y
index 34f07b68d2..e20670242d 100644
index fa84123903..610bd34731 100644
--- a/src/usr.sbin/ntpd/parse.y
+++ b/src/usr.sbin/ntpd/parse.y
@@ -436,11 +436,13 @@ weight : WEIGHT NUMBER {
@@ -480,11 +480,13 @@ weight : WEIGHT NUMBER {
opts.weight = $2;
}
rtable : RTABLE NUMBER {
@ -112,5 +112,5 @@ index 123b6939a2..8c18eb7610 100644
if (bind(la->fd, (struct sockaddr *)&la->sa,
SA_LEN((struct sockaddr *)&la->sa)) == -1) {
--
2.21.0
2.26.0

+ 4
- 4
patches/0005-update-ntpd.conf-to-indicate-OS-dependent-options.patch View File

@ -1,4 +1,4 @@
From d6ae8d21a3131655dc8bb36cebf6433b4f17242d Mon Sep 17 00:00:00 2001
From 4b701bccb4a9e1e8b87a7846f54a4eef06eedae5 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:20:03 -0600
Subject: [PATCH 05/15] update ntpd.conf to indicate OS-dependent options
@ -11,7 +11,7 @@ Debian bug ID: 575705
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.conf.5 b/src/usr.sbin/ntpd/ntpd.conf.5
index 08062bcf28..eee239bf52 100644
index 2a92c3ba10..775343f400 100644
--- a/src/usr.sbin/ntpd/ntpd.conf.5
+++ b/src/usr.sbin/ntpd/ntpd.conf.5
@@ -38,9 +38,14 @@ The basic configuration options are as follows:
@ -39,7 +39,7 @@ index 08062bcf28..eee239bf52 100644
By default
.Xr ntpd 8
will listen using the current routing table.
@@ -85,7 +90,7 @@ query from 2001:db8::1
@@ -87,7 +92,7 @@ query from 2001:db8::1
.Xc
Specify a timedelta sensor device
.Xr ntpd 8
@ -49,5 +49,5 @@ index 08062bcf28..eee239bf52 100644
.Xr ntpd 8
will use each given sensor that actually exists.
--
2.21.0
2.26.0

+ 4
- 4
patches/0006-allow-overriding-default-user-and-file-locations.patch View File

@ -1,4 +1,4 @@
From 3bce366dca75d5dbb6f5f3c9feba638b45c28a02 Mon Sep 17 00:00:00 2001
From 3998296544302fe6b35080b26786e8cc5d5f2b1f Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Thu, 1 Jan 2015 07:18:11 -0600
Subject: [PATCH 06/15] allow overriding default user and file locations
@ -10,10 +10,10 @@ default user.
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index d438a6576d..0f7313c78e 100644
index 05493ad1b2..98f235be94 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -35,10 +35,20 @@
@@ -36,10 +36,20 @@
#define MAXIMUM(a, b) ((a) > (b) ? (a) : (b))
@ -38,5 +38,5 @@ index d438a6576d..0f7313c78e 100644
#if defined(SO_SETFIB)
#define SO_RTABLE SO_SETFIB
--
2.21.0
2.26.0

+ 34
- 34
patches/0007-add-p-option-to-create-a-pid-file.patch View File

@ -1,4 +1,4 @@
From e8dd7c12e49eabc469e48dde3da59ce743318d92 Mon Sep 17 00:00:00 2001
From 37e1adef5771473c66ac447dbaa9d7479f8cf06b Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Wed, 31 Dec 2014 08:26:41 -0600
Subject: [PATCH 07/15] add -p option to create a pid file
@ -13,32 +13,32 @@ Origin: https://bugs.gentoo.org/show_bug.cgi?id=493082
3 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.8 b/src/usr.sbin/ntpd/ntpd.8
index 0b74c2587f..63b027403c 100644
index f5fe1db9d8..98af025991 100644
--- a/src/usr.sbin/ntpd/ntpd.8
+++ b/src/usr.sbin/ntpd/ntpd.8
@@ -25,6 +25,7 @@
.Bk -words
.Op Fl dnSsv
.Op Fl dnv
.Op Fl f Ar file
+.Op Fl p Ar file
.Ek
.Sh DESCRIPTION
The
@@ -59,6 +60,9 @@ instead of the default
.It Fl n
Configtest mode.
Only check the configuration file for validity.
@@ -67,6 +68,9 @@ configured NTP servers to reply.
This option allows
.Nm
to send DEBUG priority messages to syslog.
+.It Fl p Ar file
+Write pid to
+.Ar file
.It Fl S
Do not set the time immediately at startup.
This is the default.
.El
.Pp
.Nm
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 44c4f72f3f..7c8eda5a1d 100644
index e015d1d093..a0da39adf7 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -88,6 +88,18 @@ sighdlr(int sig)
@@ -90,6 +90,18 @@ sighdlr(int sig)
}
}
@ -57,16 +57,16 @@ index 44c4f72f3f..7c8eda5a1d 100644
__dead void
usage(void)
{
@@ -97,7 +109,7 @@ usage(void)
@@ -99,7 +111,7 @@ usage(void)
fprintf(stderr,
"usage: ntpctl -s all | peers | Sensors | status\n");
else
- fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n",
+ fprintf(stderr, "usage: %s [-dnSsv] [-f file] [-p file]\n",
- fprintf(stderr, "usage: %s [-dnv] [-f file]\n",
+ fprintf(stderr, "usage: %s [-dnv] [-f file] [-p file]\n",
__progname);
exit(1);
}
@@ -133,7 +145,7 @@ main(int argc, char *argv[])
@@ -151,7 +163,7 @@ main(int argc, char *argv[])
memset(&lconf, 0, sizeof(lconf));
@ -74,8 +74,8 @@ index 44c4f72f3f..7c8eda5a1d 100644
+ while ((ch = getopt(argc, argv, "df:np:P:sSv")) != -1) {
switch (ch) {
case 'd':
lconf.debug = 2;
@@ -148,6 +160,9 @@ main(int argc, char *argv[])
lconf.debug = 1;
@@ -166,6 +178,9 @@ main(int argc, char *argv[])
case 'P':
pname = optarg;
break;
@ -83,23 +83,23 @@ index 44c4f72f3f..7c8eda5a1d 100644
+ lconf.pid_file = optarg;
+ break;
case 's':
lconf.settime = 1;
break;
@@ -214,9 +229,11 @@ main(int argc, char *argv[])
case 'S':
sopt = ch;
@@ -244,9 +259,11 @@ main(int argc, char *argv[])
logdest = lconf.debug ? LOG_TO_STDERR : LOG_TO_SYSLOG;
if (!lconf.settime) {
log_init(lconf.debug, LOG_DAEMON);
log_setverbose(lconf.verbose);
log_init(logdest, lconf.verbose, LOG_DAEMON);
- if (!lconf.debug)
+ if (!lconf.debug) {
if (daemon(1, 0))
fatal("daemon");
+ writepid(&lconf);
+ }
} else
timeout = SETTIME_TIMEOUT * 1000;
@@ -298,9 +315,11 @@ main(int argc, char *argv[])
log_setverbose(lconf.verbose);
} else {
settime_deadline = getmonotime();
timeout = 100;
@@ -330,9 +347,11 @@ main(int argc, char *argv[])
log_init(logdest, lconf.verbose, LOG_DAEMON);
log_warnx("no reply received in time, skipping initial "
"time setting");
- if (!lconf.debug)
@ -111,7 +111,7 @@ index 44c4f72f3f..7c8eda5a1d 100644
}
if (nfds > 0 && (pfd[PFD_PIPE].revents & POLLOUT))
@@ -339,6 +358,8 @@ main(int argc, char *argv[])
@@ -371,6 +390,8 @@ main(int argc, char *argv[])
msgbuf_clear(&ibuf->w);
free(ibuf);
log_info("Terminating");
@ -120,7 +120,7 @@ index 44c4f72f3f..7c8eda5a1d 100644
return (0);
}
@@ -399,9 +420,11 @@ dispatch_imsg(struct ntpd_conf *lconf, int argc, char **argv)
@@ -431,9 +452,11 @@ dispatch_imsg(struct ntpd_conf *lconf, int argc, char **argv)
memcpy(&d, imsg.data, sizeof(d));
ntpd_settime(d);
/* daemonize now */
@ -134,17 +134,17 @@ index 44c4f72f3f..7c8eda5a1d 100644
timeout = INFTIM;
break;
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 0f7313c78e..7ee919dd09 100644
index 98f235be94..bd5e7701a0 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -250,6 +250,7 @@ struct ntpd_conf {
u_int constraint_errors;
@@ -267,6 +267,7 @@ struct ntpd_conf {
u_int8_t *ca;
size_t ca_len;
int tmpfail;
+ char *pid_file;
};
struct ctl_show_status {
--
2.21.0
2.26.0

+ 8
- 8
patches/0008-initialize-setproctitle-where-needed.patch View File

@ -1,4 +1,4 @@
From 9825a144612213491b7a4c6063407e0c08183384 Mon Sep 17 00:00:00 2001
From 6c82208423d5a2c452f558eff28b841614dd4c60 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 06:18:31 -0600
Subject: [PATCH 08/15] initialize setproctitle where needed
@ -10,10 +10,10 @@ clobbering them.
1 file changed, 20 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 7c8eda5a1d..4e4efa45c8 100644
index a0da39adf7..7259bb6236 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -118,6 +118,13 @@ usage(void)
@@ -134,6 +134,13 @@ auto_preconditions(const struct ntpd_conf *cnf)
#define PFD_PIPE 0
#define PFD_MAX 1
@ -27,16 +27,16 @@ index 7c8eda5a1d..4e4efa45c8 100644
int
main(int argc, char *argv[])
{
@@ -136,6 +143,8 @@ main(int argc, char *argv[])
char **argv0 = argv;
char *pname = NULL;
@@ -154,6 +161,8 @@ main(int argc, char *argv[])
time_t settime_deadline;
int sopt = 0;
+ __progname = get_progname(argv[0]);
+
if (strcmp(__progname, "ntpctl") == 0) {
ctl_main(argc, argv);
/* NOTREACHED */
@@ -145,6 +154,17 @@ main(int argc, char *argv[])
@@ -163,6 +172,17 @@ main(int argc, char *argv[])
memset(&lconf, 0, sizeof(lconf));
@ -55,5 +55,5 @@ index 7c8eda5a1d..4e4efa45c8 100644
switch (ch) {
case 'd':
--
2.21.0
2.26.0

+ 9
- 9
patches/0009-Notify-the-user-when-constraint-support-is-disabled.patch View File

@ -1,4 +1,4 @@
From 521fd6f63f1b75b9a921d60f7dbb96da253418fd Mon Sep 17 00:00:00 2001
From 6f149a27d07f574cf47a79b30f4f977e21477b1e Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Fri, 27 Mar 2015 23:14:15 -0500
Subject: [PATCH 09/15] Notify the user when constraint support is disabled.
@ -13,10 +13,10 @@ From Paul B. Henson.
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
index 0208b8dfb4..c2f9422f38 100644
index 224c913383..8f913d8b1e 100644
--- a/src/usr.sbin/ntpd/config.c
+++ b/src/usr.sbin/ntpd/config.c
@@ -163,6 +163,9 @@ new_constraint(void)
@@ -184,6 +184,9 @@ new_constraint(void)
p->id = ++constraint_maxid;
p->fd = -1;
@ -27,10 +27,10 @@ index 0208b8dfb4..c2f9422f38 100644
}
diff --git a/src/usr.sbin/ntpd/constraint.c b/src/usr.sbin/ntpd/constraint.c
index 841a28829d..b537a42e57 100644
index 6529070d14..f23d363889 100644
--- a/src/usr.sbin/ntpd/constraint.c
+++ b/src/usr.sbin/ntpd/constraint.c
@@ -339,12 +339,14 @@ priv_constraint_child(const char *pw_dir, uid_t pw_uid, gid_t pw_gid)
@@ -354,12 +354,14 @@ priv_constraint_child(const char *pw_dir, uid_t pw_uid, gid_t pw_gid)
if (setpriority(PRIO_PROCESS, 0, 0) == -1)
log_warn("could not set priority");
@ -46,10 +46,10 @@ index 841a28829d..b537a42e57 100644
if (chroot(pw_dir) == -1)
fatal("chroot");
diff --git a/src/usr.sbin/ntpd/ntpd.conf.5 b/src/usr.sbin/ntpd/ntpd.conf.5
index eee239bf52..5181a9c504 100644
index 775343f400..dadf3dea6d 100644
--- a/src/usr.sbin/ntpd/ntpd.conf.5
+++ b/src/usr.sbin/ntpd/ntpd.conf.5
@@ -195,8 +195,15 @@ authenticated constraint,
@@ -216,8 +216,15 @@ authenticated constraint,
thereby reducing the impact of unauthenticated NTP
man-in-the-middle attacks.
Received NTP packets with time information falling outside of a range
@ -65,8 +65,8 @@ index eee239bf52..5181a9c504 100644
+.Xr ntpd 8
+to log a warning message on startup.
.Bl -tag -width Ds
.It Ic constraint from Ar url
.It Ic constraint from Ar url [ip...]
Specify the URL, IP address or the hostname of an HTTPS server to
--
2.21.0
2.26.0

+ 5
- 5
patches/0010-add-a-method-for-updating-the-realtime-clock-on-sync.patch View File

@ -1,4 +1,4 @@
From b750ccf4848683b40f8477cee584d80f5aaf94f7 Mon Sep 17 00:00:00 2001
From 2dcfd7a12341ae71837622ccc1433dedadbd256d Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 4 May 2015 04:27:29 -0500
Subject: [PATCH 10/15] add a method for updating the realtime clock on sync
@ -9,10 +9,10 @@ from Christian Weisgerber
1 file changed, 2 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 4e4efa45c8..a0b2ab339e 100644
index 7259bb6236..322b337a68 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -56,6 +56,7 @@ const char *ctl_lookup_option(char *, const char **);
@@ -58,6 +58,7 @@ const char *ctl_lookup_option(char *, const char **);
void show_status_msg(struct imsg *);
void show_peer_msg(struct imsg *, int);
void show_sensor_msg(struct imsg *, int);
@ -20,7 +20,7 @@ index 4e4efa45c8..a0b2ab339e 100644
volatile sig_atomic_t quit = 0;
volatile sig_atomic_t reconfig = 0;
@@ -493,6 +494,7 @@ ntpd_adjtime(double d)
@@ -525,6 +526,7 @@ ntpd_adjtime(double d)
else if (!firstadj && olddelta.tv_sec == 0 && olddelta.tv_usec == 0)
synced = 1;
firstadj = 0;
@ -29,5 +29,5 @@ index 4e4efa45c8..a0b2ab339e 100644
}
--
2.21.0
2.26.0

+ 10
- 10
patches/0011-Deal-with-missing-SO_TIMESTAMP.patch View File

@ -1,4 +1,4 @@
From fcd0f185ff850a4766211ecbc3a65d01f7d16008 Mon Sep 17 00:00:00 2001
From 3a3c38a0e696c6a6aa32853fc1fbf72a738b1cab Mon Sep 17 00:00:00 2001
From: Brent Cook <bcook@openbsd.org>
Date: Sun, 6 Dec 2015 22:35:38 -0600
Subject: [PATCH 11/15] Deal with missing SO_TIMESTAMP
@ -11,10 +11,10 @@ Fall back to the previous client.c implementation when it is not found.
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
index aa9fc24c68..bb5c4f4c0e 100644
index 98a1eb5825..9dc131a11e 100644
--- a/src/usr.sbin/ntpd/client.c
+++ b/src/usr.sbin/ntpd/client.c
@@ -175,10 +175,12 @@ client_query(struct ntp_peer *p)
@@ -193,10 +193,12 @@ client_query(struct ntp_peer *p)
if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query->fd,
IPPROTO_IP, IP_TOS, &val, sizeof(val)) == -1)
log_warn("setsockopt IPTOS_LOWDELAY");
@ -27,7 +27,7 @@ index aa9fc24c68..bb5c4f4c0e 100644
}
/*
@@ -225,7 +227,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
@@ -283,7 +285,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic)
struct cmsghdr hdr;
char buf[CMSG_SPACE(sizeof(tv))];
} cmsgbuf;
@ -37,7 +37,7 @@ index aa9fc24c68..bb5c4f4c0e 100644
ssize_t size;
double T1, T2, T3, T4;
time_t interval;
@@ -238,7 +242,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
@@ -296,7 +300,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic)
somsg.msg_control = cmsgbuf.buf;
somsg.msg_controllen = sizeof(cmsgbuf.buf);
@ -45,7 +45,7 @@ index aa9fc24c68..bb5c4f4c0e 100644
if ((size = recvmsg(p->query->fd, &somsg, 0)) == -1) {
if (errno == EHOSTUNREACH || errno == EHOSTDOWN ||
errno == ENETUNREACH || errno == ENETDOWN ||
@@ -263,6 +266,8 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
@@ -321,6 +324,8 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic)
return (0);
}
@ -54,7 +54,7 @@ index aa9fc24c68..bb5c4f4c0e 100644
for (cmsg = CMSG_FIRSTHDR(&somsg); cmsg != NULL;
cmsg = CMSG_NXTHDR(&somsg, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET &&
@@ -272,6 +277,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
@@ -330,6 +335,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime, u_int8_t automatic)
break;
}
}
@ -62,8 +62,8 @@ index aa9fc24c68..bb5c4f4c0e 100644
+ T4 = gettime_corrected();
+#endif
if (T4 < JAN_1970) {
client_log_error(p, "recvmsg control format", EBADF);
ntp_getmsg((struct sockaddr *)&p->addr->ss, buf, size, &msg);
--
2.21.0
2.26.0

+ 5
- 5
patches/0012-check-result-of-ftello-ftruncate.patch View File

@ -1,4 +1,4 @@
From 0e6b5facebc2561a99b04f8538d3dc61dab68196 Mon Sep 17 00:00:00 2001
From 02a48411868c16abf48c67c8e514b3893734fbbb Mon Sep 17 00:00:00 2001
From: Brent Cook <bcook@openbsd.org>
Date: Mon, 21 Dec 2015 05:53:20 -0600
Subject: [PATCH 12/15] check result of ftello/ftruncate
@ -8,10 +8,10 @@ Subject: [PATCH 12/15] check result of ftello/ftruncate
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index a0b2ab339e..c3b7ab07e1 100644
index 322b337a68..daa077dcda 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -597,6 +597,7 @@ writefreq(double d)
@@ -632,6 +632,7 @@ writefreq(double d)
{
int r;
static int warnonce = 1;
@ -19,7 +19,7 @@ index a0b2ab339e..c3b7ab07e1 100644
if (freqfp == NULL)
return 0;
@@ -610,8 +611,10 @@ writefreq(double d)
@@ -645,8 +646,10 @@ writefreq(double d)
clearerr(freqfp);
return 0;
}
@ -33,5 +33,5 @@ index a0b2ab339e..c3b7ab07e1 100644
}
--
2.21.0
2.26.0

+ 2
- 2
patches/0013-set-IPV6_V6ONLY-if-we-are-binding-to-an-IPv6-address.patch View File

@ -1,4 +1,4 @@
From fc27d536a1ce4eec8b5cfc689d7b8671b5ae58ef Mon Sep 17 00:00:00 2001
From c7afac3bec625a2ed9c5a6f52c900ff680ab25bd Mon Sep 17 00:00:00 2001
From: Brent Cook <bcook@openbsd.org>
Date: Sat, 13 Aug 2016 14:22:02 -0500
Subject: [PATCH 13/15] set IPV6_V6ONLY if we are binding to an IPv6 address
@ -35,5 +35,5 @@ index 8c18eb7610..9eab1a74bf 100644
if (la->rtable != -1 &&
setsockopt(la->fd, SOL_SOCKET, SO_RTABLE, &la->rtable,
--
2.21.0
2.26.0

+ 4
- 4
patches/0014-use-adjtimex-over-adjtime-check-return-value-and-adj.patch View File

@ -1,4 +1,4 @@
From 26d528a642433031e14580cad0db841b6f60897d Mon Sep 17 00:00:00 2001
From b0f5ec0bb3f01ae852c3eb2e8e8c1947d2b5235a Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Sat, 19 Jan 2019 04:25:44 -0600
Subject: [PATCH 14/15] use adjtimex over adjtime, check return value and
@ -9,7 +9,7 @@ Subject: [PATCH 14/15] use adjtimex over adjtime, check return value and
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index c3b7ab07e1..8d4bffa3e3 100644
index daa077dcda..5817fff78a 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -17,6 +17,9 @@
@ -22,7 +22,7 @@ index c3b7ab07e1..8d4bffa3e3 100644
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/socket.h>
@@ -478,21 +481,44 @@ reset_adjtime(void)
@@ -510,21 +513,44 @@ reset_adjtime(void)
int
ntpd_adjtime(double d)
{
@ -71,5 +71,5 @@ index c3b7ab07e1..8d4bffa3e3 100644
update_time_sync_status(synced);
return (synced);
--
2.21.0
2.26.0

+ 6
- 6
patches/0015-increase-buffer-sizes-potential-truncation.patch View File

@ -1,4 +1,4 @@
From 2c93917c251e941b7caa2e874051634f8da00814 Mon Sep 17 00:00:00 2001
From 8701c68a6fb913bd5f7d003943cb0fde616a52ee Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Sat, 13 Apr 2019 04:45:22 -0500
Subject: [PATCH 15/15] increase buffer sizes potential truncation
@ -9,10 +9,10 @@ Subject: [PATCH 15/15] increase buffer sizes potential truncation
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 8d4bffa3e3..ded54fa65e 100644
index 5817fff78a..bae6abd00f 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -873,7 +873,7 @@ show_peer_msg(struct imsg *imsg, int calledfromshowall)
@@ -909,7 +909,7 @@ show_peer_msg(struct imsg *imsg, int calledfromshowall)
{
struct ctl_show_peer *cpeer;
int cnt;
@ -22,10 +22,10 @@ index 8d4bffa3e3..ded54fa65e 100644
if (imsg->hdr.type == IMSG_CTL_SHOW_PEERS_END) {
diff --git a/src/usr.sbin/ntpd/util.c b/src/usr.sbin/ntpd/util.c
index c7fd0e3324..a3abc53425 100644
index be113ba856..65eb9018bb 100644
--- a/src/usr.sbin/ntpd/util.c
+++ b/src/usr.sbin/ntpd/util.c
@@ -134,7 +134,7 @@ d_to_sfp(double d)
@@ -141,7 +141,7 @@ d_to_sfp(double d)
char *
print_rtable(int r)
{
@ -35,5 +35,5 @@ index c7fd0e3324..a3abc53425 100644
b[0] = 0;
if (r > 0)
--
2.21.0
2.26.0

Loading…
Cancel
Save