1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-05 06:27:37 +00:00

Update to 5.9p1. Notable changes:

* The rtable option was removed from server and servers. Users of
  "server * rtable X" will need to switch to launching ntpd with
  # setfib -F X /usr/sbin/ntpd
* Various improvements to the HTTPS constraint feature (requires
  LibreSSL).

This port reenables rtable support in the listen option on FreeBSD.

Relnotes:	http://www.openntpd.org/txt/release-5.9p1.txt
This commit is contained in:
Christian Weisgerber 2016-04-02 16:04:34 +00:00
parent 1a5396aa84
commit 2728a66081
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=412413
10 changed files with 77 additions and 63 deletions

View File

@ -1,8 +1,7 @@
# $FreeBSD$
PORTNAME= openntpd
PORTVERSION= 5.7p4
PORTREVISION= 2
PORTVERSION= 5.9p1
PORTEPOCH= 2
CATEGORIES= net
MASTER_SITES= OPENBSD/OpenNTPD
@ -20,20 +19,19 @@ USE_RC_SUBR= openntpd
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-silent-rules
# * LibreSSL fails with the certificiate bundle from ca_root_nss;
# 3.22.2 appears to work just fine (unlike 3.22).
# * USE_OPENSSL does not handle LibreSSL yet.
OPTIONS_DEFINE= RESSL
RESSL_DESC= SSL/TLS support via LibreSSL
OPTIONS_DEFAULT= RESSL
RESSL_LIB_DEPENDS= libtls.so:security/libressl
# Requires libtls from LibreSSL >= 2.3.2
RESSL_USE= openssl=yes
RESSL_VARS= with_openssl_port=yes \
openssl_port=security/libressl-devel
RESSL_CONFIGURE_WITH= cacert=${LOCALBASE}/etc/ssl/cert.pem
RESSL_CPPFLAGS= -I${LOCALBASE}/include
RESSL_LDFLAGS= -L${LOCALBASE}/lib
RESSL_RUN_DEPENDS= ca_root_nss>=3.22.2:security/ca_root_nss
RESSL_RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss
pre-build:
${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \

View File

@ -1,2 +1,2 @@
SHA256 (openntpd-5.7p4.tar.gz) = a993d95976e375acc0ab1a677fd268f55024477835633c8ae404895046bccb23
SIZE (openntpd-5.7p4.tar.gz) = 427900
SHA256 (openntpd-5.9p1.tar.gz) = 200c04056d4d6441653cac71d515611f3903aa7b15b8f5661a40dab3fb3697b3
SIZE (openntpd-5.9p1.tar.gz) = 432844

View File

@ -17,7 +17,7 @@
check_process()
{
pgrep -f 'ntpd: \[priv\]'
pgrep -f $command
}
name=openntpd

View File

@ -1,23 +0,0 @@
--- compat/adjfreq_freebsd.c.orig 2015-03-12 04:42:13 UTC
+++ compat/adjfreq_freebsd.c
@@ -57,3 +57,20 @@ adjfreq(const int64_t *freq, int64_t *ol
return 0;
}
+
+/*
+ * The RTC is only updated if the clock is not marked as unsynced.
+ */
+
+void
+update_status(int synced)
+{
+ struct timex txc = { 0 };
+
+ txc.modes = MOD_STATUS;
+ if (!synced)
+ txc.status = STA_UNSYNC;
+ if (ntp_adjtime(&txc) == -1)
+ log_warn("ntp_adjtime (3) failed");
+ return;
+}

View File

@ -0,0 +1,10 @@
--- include/signal.h.orig 2015-05-04 09:54:32 UTC
+++ include/signal.h
@@ -8,3 +8,7 @@
#ifndef SIGINFO
#define SIGINFO SIGUSR1
#endif
+
+#ifndef _NSIG
+#define _NSIG NSIG
+#endif

View File

@ -1,6 +1,6 @@
--- src/constraint.c.orig 2015-03-14 21:24:11 UTC
--- src/constraint.c.orig 2016-03-28 13:51:51 UTC
+++ src/constraint.c
@@ -665,7 +665,7 @@ httpsdate_request(struct httpsdate *http
@@ -905,7 +905,7 @@ httpsdate_request(struct httpsdate *http
* or ANSI C's asctime() - the latter doesn't include
* the timezone which is required here.
*/

View File

@ -1,6 +1,6 @@
--- src/ntpd.8.orig 2015-03-18 16:25:53 UTC
--- src/ntpd.8.orig 2016-03-28 13:51:51 UTC
+++ src/ntpd.8
@@ -57,7 +57,7 @@ Use
@@ -56,7 +56,7 @@ Use
.Ar file
as the configuration file,
instead of the default
@ -9,7 +9,7 @@
.It Fl n
Configtest mode.
Only check the configuration file for validity.
@@ -100,19 +100,19 @@ will be logged.
@@ -99,19 +99,19 @@ will be logged.
After the local clock is synchronized,
.Nm
adjusts the clock frequency using the
@ -33,9 +33,9 @@
for more information on the boot process
and enabling daemons.
.Pp
@@ -137,8 +137,8 @@ signal on systems without
it writes its peer and sensor status to
.Xr syslog 3 .
@@ -124,8 +124,8 @@ and its initial clock drift from
.Pa /var/db/ntpd.drift .
Clock drift is periodically written to the drift file thereafter.
.Sh FILES
-.Bl -tag -width "/var/db/ntpd.driftXXX" -compact
-.It Pa /etc/ntpd.conf
@ -44,7 +44,7 @@
Default configuration file.
.It Pa /var/db/ntpd.drift
Drift file.
@@ -148,12 +148,12 @@ Socket file for communication with
@@ -135,12 +135,12 @@ Socket file for communication with
.El
.Sh SEE ALSO
.Xr date 1 ,

View File

@ -1,18 +0,0 @@
--- src/ntpd.c.orig 2015-03-25 01:18:56 UTC
+++ src/ntpd.c
@@ -53,6 +53,7 @@ const char *ctl_lookup_option(char *
void show_status_msg(struct imsg *);
void show_peer_msg(struct imsg *, int);
void show_sensor_msg(struct imsg *, int);
+void update_status(int);
volatile sig_atomic_t quit = 0;
volatile sig_atomic_t reconfig = 0;
@@ -423,6 +424,7 @@ ntpd_adjtime(double d)
else if (!firstadj && olddelta.tv_sec == 0 && olddelta.tv_usec == 0)
synced = 1;
firstadj = 0;
+ update_status(synced);
return (synced);
}

View File

@ -1,6 +1,6 @@
--- src/ntpd.conf.5.orig 2015-03-18 16:25:53 UTC
--- src/ntpd.conf.5.orig 2016-03-28 13:51:51 UTC
+++ src/ntpd.conf.5
@@ -222,8 +222,8 @@ constraints from "https://www.google.com
@@ -218,8 +218,8 @@ constraints from "https://www.google.com
.Ed
.El
.Sh FILES

View File

@ -0,0 +1,47 @@
--- src/server.c.orig 2016-03-28 13:51:51 UTC
+++ src/server.c
@@ -36,14 +36,14 @@ setup_listeners(struct servent *se, stru
struct ifaddrs *ifa, *ifap;
struct sockaddr *sa;
#ifdef SO_RTABLE
- struct if_data *ifd;
+ struct ifreq ifr;
#endif
u_int8_t *a6;
size_t sa6len = sizeof(struct in6_addr);
u_int new_cnt = 0;
int tos = IPTOS_LOWDELAY;
#ifdef SO_RTABLE
- int rdomain = 0;
+ int rdomain, fd;
#endif
TAILQ_FOREACH(lap, &lconf->listen_addrs, entry) {
@@ -56,16 +56,21 @@ setup_listeners(struct servent *se, stru
sa = ifap->ifa_addr;
if (sa == NULL || SA_LEN(sa) == 0)
continue;
-#ifdef SO_RTABLE
- if (sa->sa_family == AF_LINK) {
- ifd = ifap->ifa_data;
- rdomain = ifd->ifi_rdomain;
- }
-#endif
if (sa->sa_family != AF_INET &&
sa->sa_family != AF_INET6)
continue;
#ifdef SO_RTABLE
+ strlcpy(ifr.ifr_name, ifap->ifa_name,
+ sizeof(ifr.ifr_name));
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (ioctl(fd, SIOCGIFRDOMAIN,
+ (caddr_t)&ifr) == -1)
+ rdomain = 0;
+ else
+ rdomain = ifr.ifr_rdomainid;
+ close(fd);
+
if (lap->rtable != -1 && rdomain != lap->rtable)
continue;
#endif