git: 17bf9810cc0a - 2025Q1 - net/ntp: ntpd does not connect to NTP server with link local IPv6 address

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Wed, 19 Feb 2025 04:34:02 UTC
The branch 2025Q1 has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=17bf9810cc0a94d3606b2a70b09a36d424e7d160

commit 17bf9810cc0a94d3606b2a70b09a36d424e7d160
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-02-19 03:33:23 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-02-19 03:58:05 +0000

    net/ntp: ntpd does not connect to NTP server with link local IPv6 address
    
    Upstream bug 3943 (https://bugs.ntp.org/show_bug.cgi?id=3943) discusses:
    
    Starting with 4.2.8p18 ntp does not synchronize or even connect to the
    configured NTP server any more. ntp stays in .INIT. state indefinitely
    and checking the network traffic shows that ntp does not attempt to
    contact the NTP server.
    
    This is regression introduced by the fix for upstream bug 3913. This
    is a similar bug I reported upstream (ntp bug 3841).
    
    Obtained from:  src 381956e26756
    
    (cherry picked from commit 453bd9639bae31c05fa0eda782af0926a12a8b42)
---
 net/ntp/Makefile                   |  2 +-
 net/ntp/files/patch-ntpd_ntp__io.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/net/ntp/Makefile b/net/ntp/Makefile
index eedd057fd5d4..c48eccfe6046 100644
--- a/net/ntp/Makefile
+++ b/net/ntp/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ntp
 PORTVERSION=	4.2.8p18
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ \
 		http://archive.ntp.org/ntp4/ntp-4.2/
diff --git a/net/ntp/files/patch-ntpd_ntp__io.c b/net/ntp/files/patch-ntpd_ntp__io.c
new file mode 100644
index 000000000000..b2bbf0fee058
--- /dev/null
+++ b/net/ntp/files/patch-ntpd_ntp__io.c
@@ -0,0 +1,11 @@
+--- ntpd/ntp_io.c.orig	2024-05-07 04:21:17.000000000 -0700
++++ ntpd/ntp_io.c	2025-02-18 19:31:18.434141000 -0800
+@@ -3205,7 +3205,7 @@
+ 	}
+ 
+ 	do {
+-		if (INT_LL_OF_GLOB & src->flags) {
++		if (ismcast && INT_LL_OF_GLOB & src->flags) {
+ 			/* avoid duplicate multicasts on same IPv6 net */
+ 			goto loop;
+ 		}