Browse Source

rebase patches

OPENBSD_5_7
Brent Cook 9 years ago
parent
commit
21bbb4be66
10 changed files with 55 additions and 54 deletions
  1. +3
    -3
      patches/0001-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch
  2. +4
    -4
      patches/0002-EAI_NODATA-does-not-exist-everywhere.patch
  3. +2
    -2
      patches/0003-Use-LOG_NTP-syslog-facility-if-it-is-available.patch
  4. +6
    -6
      patches/0004-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch
  5. +9
    -8
      patches/0005-check-if-rdomain-support-is-available.patch
  6. +4
    -4
      patches/0006-update-ntpd.conf-to-indicate-OS-dependent-options.patch
  7. +3
    -3
      patches/0007-allow-overriding-default-user-and-file-locations.patch
  8. +17
    -17
      patches/0008-add-p-option-to-create-a-pid-file.patch
  9. +5
    -5
      patches/0009-initialize-setproctitle-where-needed.patch
  10. +2
    -2
      patches/0010-document-SIGUSR1-fallback-if-SIGINFO-is-not-implemen.patch

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

@ -1,7 +1,7 @@
From c1965168591c557f8eca31399553c0988cffb18f Mon Sep 17 00:00:00 2001
From 9e246d0c8dbe98db5e2408a3472d380ddebf7717 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/11] Handle IPv6 DNS records on IPv4 networks more liberally
Subject: [PATCH 01/10] Handle IPv6 DNS records on IPv4 networks more liberally
Rather than fail on IPv4 only networks when seeing an IPv6 DNS record,
just give a warning.
@ -13,7 +13,7 @@ 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 3ae2c18..9a499b1 100644
index 21711ae..18aa81d 100644
--- a/src/usr.sbin/ntpd/client.c
+++ b/src/usr.sbin/ntpd/client.c
@@ -138,9 +138,16 @@ client_query(struct ntp_peer *p)


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

@ -1,7 +1,7 @@
From c6101d58f26d67ea731745592b35fcb4b05f1ab3 Mon Sep 17 00:00:00 2001
From 27af6267c4062130307e30a807bda9fb71ae0760 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/11] EAI_NODATA does not exist everywhere
Subject: [PATCH 02/10] EAI_NODATA does not exist everywhere
FreeBSD says it is deprecated #ifdef's it out.
@ -15,10 +15,10 @@ 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 cee0a12..45f2d87 100644
index 3945405..8c1baa2 100644
--- a/src/usr.sbin/ntpd/config.c
+++ b/src/usr.sbin/ntpd/config.c
@@ -132,8 +132,14 @@ host_dns(const char *s, struct ntp_addr **hn)
@@ -133,8 +133,14 @@ host_dns(const char *s, struct ntp_addr **hn)
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
/* ntpd MUST NOT use AI_ADDRCONFIG here */
error = getaddrinfo(s, NULL, &hints, &res0);


+ 2
- 2
patches/0003-Use-LOG_NTP-syslog-facility-if-it-is-available.patch View File

@ -1,7 +1,7 @@
From 5ff8767d8c59f65d4e2706cdb2a241e031f204f5 Mon Sep 17 00:00:00 2001
From 627d0d1bf727acc53e2ac58136aec4780f2fdf61 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 21:16:54 -0600
Subject: [PATCH 03/11] Use LOG_NTP syslog facility if it is available
Subject: [PATCH 03/10] Use LOG_NTP syslog facility if it is available
FreeBSD PR: 114191
Submitted by: Robert Archer <freebsd@deathbeforedecaf.net>


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

@ -1,17 +1,17 @@
From b670f88c2b3aebb8b338aa855193ddd8c06d6319 Mon Sep 17 00:00:00 2001
From 4a0d934afddc6c9f0f736de84509a7c671f27ddd Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:02:50 -0600
Subject: [PATCH 04/11] conditionally fill in sin_len/sin6_len if they exist
Subject: [PATCH 04/10] conditionally fill in sin_len/sin6_len if they exist
---
src/usr.sbin/ntpd/config.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
index 45f2d87..b3d198e 100644
index 8c1baa2..2e39604 100644
--- a/src/usr.sbin/ntpd/config.c
+++ b/src/usr.sbin/ntpd/config.c
@@ -71,7 +71,9 @@ host_v4(const char *s)
@@ -72,7 +72,9 @@ host_v4(const char *s)
if ((h = calloc(1, sizeof(struct ntp_addr))) == NULL)
fatal(NULL);
sa_in = (struct sockaddr_in *)&h->ss;
@ -21,7 +21,7 @@ index 45f2d87..b3d198e 100644
sa_in->sin_family = AF_INET;
sa_in->sin_addr.s_addr = ina.s_addr;
@@ -93,7 +95,9 @@ host_v6(const char *s)
@@ -94,7 +96,9 @@ host_v6(const char *s)
if ((h = calloc(1, sizeof(struct ntp_addr))) == NULL)
fatal(NULL);
sa_in6 = (struct sockaddr_in6 *)&h->ss;
@ -31,7 +31,7 @@ index 45f2d87..b3d198e 100644
sa_in6->sin6_family = AF_INET6;
memcpy(&sa_in6->sin6_addr,
&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr,
@@ -155,12 +159,16 @@ host_dns(const char *s, struct ntp_addr **hn)
@@ -156,12 +160,16 @@ host_dns(const char *s, struct ntp_addr **hn)
h->ss.ss_family = res->ai_family;
if (res->ai_family == AF_INET) {
sa_in = (struct sockaddr_in *)&h->ss;


+ 9
- 8
patches/0005-check-if-rdomain-support-is-available.patch View File

@ -1,7 +1,7 @@
From b911b4bf173e66a3d8c4a1323e89343d2957eb61 Mon Sep 17 00:00:00 2001
From d5d1799dba61af8a263507839a9a2f92293093ae Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:05:46 -0600
Subject: [PATCH 05/11] check if rdomain support is available.
Subject: [PATCH 05/10] check if rdomain support is available.
Handle FreeBSD's calling rdomain 'FIB'.
- from naddy@openbsd.org
@ -13,7 +13,7 @@ Handle FreeBSD's calling rdomain 'FIB'.
4 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
index 9a499b1..fc9186a 100644
index 18aa81d..d47869b 100644
--- a/src/usr.sbin/ntpd/client.c
+++ b/src/usr.sbin/ntpd/client.c
@@ -149,10 +149,12 @@ client_query(struct ntp_peer *p)
@ -43,7 +43,7 @@ index 9a499b1..fc9186a 100644
for (cmsg = CMSG_FIRSTHDR(&somsg); cmsg != NULL;
cmsg = CMSG_NXTHDR(&somsg, cmsg)) {
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 45e14bb..03d6b0c 100644
index f6e3acf..28ab1ba 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -41,6 +41,12 @@
@ -60,16 +60,17 @@ index 45e14bb..03d6b0c 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 f3db4ae..42a49f7 100644
index 8faff66..ebf85ca 100644
--- a/src/usr.sbin/ntpd/parse.y
+++ b/src/usr.sbin/ntpd/parse.y
@@ -307,10 +307,12 @@ weight : WEIGHT NUMBER {
@@ -412,11 +412,13 @@ weight : WEIGHT NUMBER {
opts.weight = $2;
}
rtable : RTABLE NUMBER {
+#ifdef RT_TABLEID_MAX
if ($2 < 0 || $2 > RT_TABLEID_MAX) {
yyerror("rtable must be between 1 and RT_TABLEID_MAX");
yyerror("rtable must be between 1"
" and RT_TABLEID_MAX");
YYERROR;
}
+#endif
@ -77,7 +78,7 @@ index f3db4ae..42a49f7 100644
}
;
diff --git a/src/usr.sbin/ntpd/server.c b/src/usr.sbin/ntpd/server.c
index 66d8bbe..f17891f 100644
index dc58b32..0c0d3dc 100644
--- a/src/usr.sbin/ntpd/server.c
+++ b/src/usr.sbin/ntpd/server.c
@@ -39,7 +39,10 @@ setup_listeners(struct servent *se, struct ntpd_conf *lconf, u_int *cnt)


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

@ -1,7 +1,7 @@
From f6ca535f9c7d8094633465d44d974495a0d3a5c6 Mon Sep 17 00:00:00 2001
From 78693e2c2d509ef30ca5a2f942657b94887bdc4e Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:20:03 -0600
Subject: [PATCH 06/11] update ntpd.conf to indicate OS-dependent options
Subject: [PATCH 06/10] update ntpd.conf to indicate OS-dependent options
Also, clarify listening behavior based on a patch from
Dererk <dererk@debian.org>
@ -11,10 +11,10 @@ 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 3e9b5b4..6315f47 100644
index accc87b..8ece0de 100644
--- a/src/usr.sbin/ntpd/ntpd.conf.5
+++ b/src/usr.sbin/ntpd/ntpd.conf.5
@@ -38,9 +38,14 @@ They are as follows:
@@ -38,9 +38,14 @@ The basic configuration options are as follows:
.It Xo Ic listen on Ar address
.Op Ic rtable Ar table-id
.Xc


+ 3
- 3
patches/0007-allow-overriding-default-user-and-file-locations.patch View File

@ -1,7 +1,7 @@
From 8cfcaaf084e9969730f3291733430098de80c3ec Mon Sep 17 00:00:00 2001
From 7ad3fc7eef6695250b03c931d41975f54674e0d9 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Thu, 1 Jan 2015 07:18:11 -0600
Subject: [PATCH 07/11] allow overriding default user and file locations
Subject: [PATCH 07/10] allow overriding default user and file locations
Allow the build process to override the default ntpd file paths and
default user.
@ -10,7 +10,7 @@ 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 03d6b0c..962e1cc 100644
index 28ab1ba..cfbd603 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -36,10 +36,20 @@


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

@ -1,7 +1,7 @@
From f284fcbe288ed0a227a44cdd715b1c5668d4b112 Mon Sep 17 00:00:00 2001
From 39b0d8bc55f07cc2d15c7a60ee77c41e00b8c9b1 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Wed, 31 Dec 2014 08:26:41 -0600
Subject: [PATCH 08/11] add -p option to create a pid file
Subject: [PATCH 08/10] add -p option to create a pid file
This is used in both the Gentoo and Debian ports.
@ -35,7 +35,7 @@ index 18b12e8..9eb1fee 100644
Do not set the time immediately at startup.
This is the default.
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index e2c189c..f5f0dbb 100644
index a02d9f5..304e050 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -83,6 +83,18 @@ sighdlr(int sig)
@ -57,16 +57,16 @@ index e2c189c..f5f0dbb 100644
__dead void
usage(void)
{
@@ -91,7 +103,7 @@ usage(void)
if (strcmp(__progname, "ntpctl") == 0)
fprintf(stderr, "usage: ntpctl [-s all | peers | Sensors | status]\n");
@@ -92,7 +104,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",
__progname);
exit(1);
}
@@ -122,7 +134,7 @@ main(int argc, char *argv[])
@@ -123,7 +135,7 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */
@ -75,7 +75,7 @@ index e2c189c..f5f0dbb 100644
switch (ch) {
case 'd':
lconf.debug = 1;
@@ -134,6 +146,9 @@ main(int argc, char *argv[])
@@ -135,6 +147,9 @@ main(int argc, char *argv[])
case 'n':
lconf.noaction = 1;
break;
@ -85,7 +85,7 @@ index e2c189c..f5f0dbb 100644
case 's':
lconf.settime = 1;
break;
@@ -174,9 +189,11 @@ main(int argc, char *argv[])
@@ -175,9 +190,11 @@ main(int argc, char *argv[])
reset_adjtime();
if (!lconf.settime) {
log_init(lconf.debug);
@ -98,7 +98,7 @@ index e2c189c..f5f0dbb 100644
} else
timeout = SETTIME_TIMEOUT * 1000;
@@ -223,9 +240,11 @@ main(int argc, char *argv[])
@@ -224,9 +241,11 @@ main(int argc, char *argv[])
log_init(lconf.debug);
log_warnx("no reply received in time, skipping initial "
"time setting");
@ -111,7 +111,7 @@ index e2c189c..f5f0dbb 100644
}
if (nfds > 0 && (pfd[PFD_PIPE].revents & POLLOUT))
@@ -264,6 +283,8 @@ main(int argc, char *argv[])
@@ -265,6 +284,8 @@ main(int argc, char *argv[])
msgbuf_clear(&ibuf->w);
free(ibuf);
log_info("Terminating");
@ -120,7 +120,7 @@ index e2c189c..f5f0dbb 100644
return (0);
}
@@ -339,9 +360,11 @@ dispatch_imsg(struct ntpd_conf *lconf)
@@ -337,9 +358,11 @@ dispatch_imsg(struct ntpd_conf *lconf)
memcpy(&d, imsg.data, sizeof(d));
ntpd_settime(d);
/* daemonize now */
@ -134,13 +134,13 @@ index e2c189c..f5f0dbb 100644
timeout = INFTIM;
break;
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 962e1cc..73d7fe1 100644
index cfbd603..8f13b00 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -206,6 +206,7 @@ struct ntpd_conf {
u_int8_t debug;
u_int8_t noaction;
u_int8_t filters;
@@ -237,6 +237,7 @@ struct ntpd_conf {
u_int constraint_errors;
u_int8_t *ca;
size_t ca_len;
+ char *pid_file;
};


+ 5
- 5
patches/0009-initialize-setproctitle-where-needed.patch View File

@ -1,7 +1,7 @@
From 3208d0b0529a09765c0674cbc4c57ab26ab30fc9 Mon Sep 17 00:00:00 2001
From f22fd1f0b3f4f5ec49c668f95776cee5214ea7e9 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 06:18:31 -0600
Subject: [PATCH 09/11] initialize setproctitle where needed
Subject: [PATCH 09/10] initialize setproctitle where needed
We need to save a copy of argv and __progname to avoid setproctitle
clobbering them.
@ -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 f5f0dbb..26463f6 100644
index 304e050..4d2d11d 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -111,6 +111,13 @@ usage(void)
@@ -112,6 +112,13 @@ usage(void)
#define POLL_MAX 8
#define PFD_PIPE 0
@ -27,7 +27,7 @@ index f5f0dbb..26463f6 100644
int
main(int argc, char *argv[])
{
@@ -134,6 +141,19 @@ main(int argc, char *argv[])
@@ -135,6 +142,19 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */


+ 2
- 2
patches/0010-document-SIGUSR1-fallback-if-SIGINFO-is-not-implemen.patch View File

@ -1,7 +1,7 @@
From 51d62c2c4c019ee1e5db2fef7a53df602b76d646 Mon Sep 17 00:00:00 2001
From f529c668149aea4c10d3192e9f17631c268ab547 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 21:17:35 -0600
Subject: [PATCH 10/11] document SIGUSR1 fallback if SIGINFO is not
Subject: [PATCH 10/10] document SIGUSR1 fallback if SIGINFO is not
implemented.
---


Loading…
Cancel
Save