From 026ad5cf663bf4ef529f4e74337e0713b9f9c22b Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 4 Jul 2018 14:04:23 +0000 Subject: [PATCH] MFC r335595-r335596 r335595: Modernize usage of "restrict" keyword in ntp.conf It is no longer necessary to specify a -4/-6 flag on any ntp.conf keyword. The address type is inferred from the address itself as necessary. "restrict default" statements always apply to both address families regardless of any -4/-6 flag that may be present. So this change just tidies up our default config by removing the redundant restrict -6 statement and comment, and by removing the -6 flag from the restrict keyword that allows access from localhost. This change was inspired by the patches provided in PRs 201803 and 210245, and included some contrib/ntp code inspection to verify that the -4/-6 keywords are basically no-ops in all contexts now. PR: 201803 210245 Differential Revision: https://reviews.freebsd.org/D15974 r335596: Fix a comment; the ntp leaplist file is updated periodically, but not weekly (it's only updated when a check shows it's within 30 days of expiring). PR: 207138 --- etc/ntp.conf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/etc/ntp.conf b/etc/ntp.conf index 977295ecd51..3a2ff63cd25 100644 --- a/etc/ntp.conf +++ b/etc/ntp.conf @@ -62,15 +62,13 @@ pool 0.freebsd.pool.ntp.org iburst # See http://support.ntp.org/bin/view/Support/AccessRestrictions # for more information. # -restrict default limited kod nomodify notrap noquery nopeer -restrict -6 default limited kod nomodify notrap noquery nopeer -restrict source limited kod nomodify notrap noquery +restrict default limited kod nomodify notrap noquery nopeer +restrict source limited kod nomodify notrap noquery # # Alternatively, the following rules would block all unauthorized access. # #restrict default ignore -#restrict -6 default ignore # # In this case, all remote NTP time servers also need to be explicitly # allowed or they would not be able to exchange time information with @@ -85,7 +83,7 @@ restrict source limited kod nomodify notrap noquery # # The following settings allow unrestricted access from the localhost restrict 127.0.0.1 -restrict -6 ::1 +restrict ::1 # # If a server loses sync with all upstream servers, NTP clients @@ -101,6 +99,6 @@ restrict -6 ::1 # See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14. # for documentation regarding leapfile. Updates to the file can be obtained # from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. -# Use either leapfile in /etc/ntp or weekly updated leapfile in /var/db. +# Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" -- 2.45.0