Bug 270536 - By default ntpd does not work on IPv6-only hosts
Summary: By default ntpd does not work on IPv6-only hosts
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
: 264088 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-30 07:58 UTC by Lapo Luchini
Modified: 2024-01-02 03:26 UTC (History)
4 users (show)

See Also:
freebsd: mfc-stable13?
freebsd: mfc-stable12?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lapo Luchini 2023-03-30 07:58:59 UTC
Default /etc/ntp.conf uses the following server:

pool 0.freebsd.pool.ntp.org iburst

which does not resolve to any IPv6 addresses:

% drill aaaa 0.freebsd.pool.ntp.org
;; ANSWER SECTION:

while 2 does:

% drill aaaa 2.freebsd.pool.ntp.org
;; ANSWER SECTION:
2.freebsd.pool.ntp.org. 150     IN      AAAA    2620:83:8000:ffd1:1::e
2.freebsd.pool.ntp.org. 150     IN      AAAA    2601:603:b7f:9731:123:4636:ddb5:5de
2.freebsd.pool.ntp.org. 150     IN      AAAA    2604:a880:1:20::8e:3001
2.freebsd.pool.ntp.org. 150     IN      AAAA    2620:149:a0c:4000::1f2

I discovered about that on the following thread:

https://community.ntppool.org/t/the-time-has-come-we-must-enable-ipv6-entirely/1968/44?page=3

I'd say it would make sense to either:

1. switch entierly from 0. to 2. in order to support IPv6, but risking problems on server which have IPv6 mis-configured
2. use both 0. and 2. in default ntp.conf, thus guaranteeing both IPv4-only answers and IPv4+IPv6 answers, ntpd will then choose the best/closest one anyways

cheers,
Lapo
Comment 1 Mina Galić freebsd_triage 2023-03-30 13:12:47 UTC
last time this (particular line) was updated was 7 years ago: https://reviews.freebsd.org/D9011

i guess it's time.
Comment 2 Mina Galić freebsd_triage 2023-05-04 10:35:32 UTC
See also: https://github.com/freebsd/freebsd-src/pull/731
See also: https://reviews.freebsd.org/D39954

(let's see which one gets picked up first ;)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-05 04:39:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=fff1551c0357cc43f6138fecfad1d79d8d8baa15

commit fff1551c0357cc43f6138fecfad1d79d8d8baa15
Author:     Mina Galic <freebsd_igalic.co>
AuthorDate: 2023-05-05 04:33:18 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-05 04:37:02 +0000

    ntpd: Support IPv6-only hosts

    0.pool.* returns only IPv4 addresses.
    2.pool.* returns both, IPv6 and IPv4 addresses.

    conservatively extend our IPv4 only pool configuration by adding a
    second pool, which also returns IPv6 addresses.

    PR:                     270536
    Reported by:            Lapo Luchini <lapo@lapo.it>
    MFC after:              3 days
    Pull Request:           https://github.com/freebsd/freebsd-src/pull/731
    Differential Revision:  https://reviews.freebsd.org/D39954

 usr.sbin/ntp/ntpd/ntp.conf | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2023-05-05 04:40:31 UTC
Committed. Thanks.
Comment 5 Mina Galić freebsd_triage 2023-05-05 05:52:07 UTC
(In reply to commit-hook from comment #3)
n.b. meta data here is mangled:

Author:     Mina Galic <freebsd_igalic.co>

Instead of

Author:     Mina Galić <freebsd@igalic.co>
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-05-08 17:34:37 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f39a2a83945c31d17e609dd6e2adcfb099ae7f0

commit 3f39a2a83945c31d17e609dd6e2adcfb099ae7f0
Author:     Mina Galic <freebsd_igalic.co>
AuthorDate: 2023-05-05 04:33:18 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-08 17:33:24 +0000

    ntpd: Support IPv6-only hosts

    0.pool.* returns only IPv4 addresses.
    2.pool.* returns both, IPv6 and IPv4 addresses.

    conservatively extend our IPv4 only pool configuration by adding a
    second pool, which also returns IPv6 addresses.

    PR:                     270536
    Reported by:            Lapo Luchini <lapo@lapo.it>
    Pull Request:           https://github.com/freebsd/freebsd-src/pull/731
    Differential Revision:  https://reviews.freebsd.org/D39954

    (cherry picked from commit fff1551c0357cc43f6138fecfad1d79d8d8baa15)

 usr.sbin/ntp/ntpd/ntp.conf | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-05-08 17:34:39 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d3ee609cf29eca3abc81db231a2f4afba42f5bb1

commit d3ee609cf29eca3abc81db231a2f4afba42f5bb1
Author:     Mina Galic <freebsd_igalic.co>
AuthorDate: 2023-05-05 04:33:18 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-05-08 04:17:59 +0000

    ntpd: Support IPv6-only hosts

    0.pool.* returns only IPv4 addresses.
    2.pool.* returns both, IPv6 and IPv4 addresses.

    conservatively extend our IPv4 only pool configuration by adding a
    second pool, which also returns IPv6 addresses.

    PR:                     270536
    Reported by:            Lapo Luchini <lapo@lapo.it>
    Pull Request:           https://github.com/freebsd/freebsd-src/pull/731
    Differential Revision:  https://reviews.freebsd.org/D39954

    (cherry picked from commit fff1551c0357cc43f6138fecfad1d79d8d8baa15)

 usr.sbin/ntp/ntpd/ntp.conf | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Comment 8 Mallory 2023-05-10 21:09:30 UTC
*** Bug 264088 has been marked as a duplicate of this bug. ***
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2024-01-02 03:26:43 UTC
^Triage: the 12 branch is now out of support.

Now committed to all supported releases.

While here, assign to committer that resolved.