git: a0eb70bcc31c - main - net/ndproxy: Update 3.2 => 3.3, fix build on 15+

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Tue, 30 Dec 2025 02:00:53 UTC
The branch main has been updated by vvd:

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

commit a0eb70bcc31ced369c538cb7083b6be87860d7d3
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-12-30 01:54:36 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-12-30 01:54:36 +0000

    net/ndproxy: Update 3.2 => 3.3, fix build on 15+
    
    Commit log:
    https://github.com/AlexandreFenyo/ndproxy/compare/v3.2...v3.3
    
    Improve port:
    - Add patch with fix build on 15+.
    - Replace PORTVERSION with DISTVERSION.
    - Add option DOCS.
    - Fix warnings from portclippy.
    
    PR:             291782
    Approved by:    Alexandre Fenyo <fbsd.bugzilla@fenyo.net> (maintainer, implicit - inactive since 2019)
    Co-authored-by: David Hauweele <david@hauweele.net>
---
 net/ndproxy/Makefile               | 22 +++++++++++++---------
 net/ndproxy/distinfo               |  6 +++---
 net/ndproxy/files/patch-ndpacket.c | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/net/ndproxy/Makefile b/net/ndproxy/Makefile
index 3ed84ce0066c..cd8218f0dda0 100644
--- a/net/ndproxy/Makefile
+++ b/net/ndproxy/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	ndproxy
-PORTVERSION=	3.2
-PORTREVISION=	1
 DISTVERSIONPREFIX=	v
+DISTVERSION=	3.3
 CATEGORIES=	net
 
 MAINTAINER=	fbsd.bugzilla@fenyo.net
@@ -12,21 +11,22 @@ LICENSE=	BSD2CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		compiler kmod
-
-BROKEN_FreeBSD_15=	ndpacket.c:186:46: error: incomplete definition of type 'struct ifnet'
-BROKEN_FreeBSD_16=	ndpacket.c:186:46: error: incomplete definition of type 'struct ifnet'
-
-SUB_FILES=	pkg-message
-
-USE_RC_SUBR=	ndproxy
 USE_GITHUB=	yes
 GH_ACCOUNT=	AlexandreFenyo
+USE_RC_SUBR=	${PORTNAME}
 
 # build for a kernel with 'options VIMAGE'
 CFLAGS+=	-DVIMAGE ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
 CFLAGS_gcc=	-Wno-error=strict-prototypes
 
+SUB_FILES=	pkg-message
+
 PLIST_FILES=	${KMODDIR}/${PORTNAME}.ko share/man/man4/${PORTNAME}.4.gz
+PORTDOCS=	README.md TESTING.TXT \
+		${PORTNAME}.html ${PORTNAME}.pdf ${PORTNAME}.ps \
+		network-architecture.png
+
+OPTIONS_DEFINE=	DOCS
 
 pre-build:
 	(cd ${BUILD_WRKSRC}; ${MAKE} depend)
@@ -35,4 +35,8 @@ do-install:
 	${INSTALL_KLD} ${WRKSRC}/${PORTNAME}.ko ${STAGEDIR}${KMODDIR}
 	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.4 ${STAGEDIR}${PREFIX}/share/man/man4/
 
+do-install-DOCS-on:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+
 .include <bsd.port.mk>
diff --git a/net/ndproxy/distinfo b/net/ndproxy/distinfo
index ecdbb126121c..3aaa7ddb2c00 100644
--- a/net/ndproxy/distinfo
+++ b/net/ndproxy/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1550596032
-SHA256 (AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz) = 8ea72bb12b26bb1ca4df31bc1bd86b3eea52d42fe2d014d890a1a067721c63dd
-SIZE (AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz) = 10172863
+TIMESTAMP = 1767050505
+SHA256 (AlexandreFenyo-ndproxy-v3.3_GH0.tar.gz) = d9d10b519985f8dcde7104f8c74698031ac3caf865f42dd9f67568ea2eff01f2
+SIZE (AlexandreFenyo-ndproxy-v3.3_GH0.tar.gz) = 10172856
diff --git a/net/ndproxy/files/patch-ndpacket.c b/net/ndproxy/files/patch-ndpacket.c
new file mode 100644
index 000000000000..0085dda064f4
--- /dev/null
+++ b/net/ndproxy/files/patch-ndpacket.c
@@ -0,0 +1,33 @@
+--- ndpacket.c.orig	2019-02-19 09:46:15 UTC
++++ ndpacket.c
+@@ -59,6 +59,12 @@
+ 
+ // called by pfil_run_hooks() @ ip6_input.c:ip_input()
+ 
++#if __FreeBSD_version < 1400000
++static uint8_t if_getaddrlen(if_t ifp) {
++	return (ifp->if_addrlen);
++}
++#endif
++
+ #ifdef PFIL_VERSION
+ pfil_return_t packet(struct mbuf **packet_mp, struct ifnet *packet_ifnet,
+                      const int packet_dir, void *packet_arg, struct inpcb *packet_inpcb) {
+@@ -183,7 +189,7 @@ int packet(void *packet_arg, struct mbuf **packet_mp, 
+   // create a new mbuf to send a neighbor advertisement
+   // ICMPv6 options are rounded up to 8 bytes alignment
+   maxlen = (sizeof(struct ip6_hdr) + sizeof(struct nd_neighbor_advert) +
+-	    sizeof(struct nd_opt_hdr) + packet_ifnet->if_addrlen + 7) & ~7;
++	    sizeof(struct nd_opt_hdr) + if_getaddrlen(packet_ifnet) + 7) & ~7;
+   if (max_linkhdr + maxlen > MCLBYTES) {
+     printf("NDPROXY ERROR: reply length > MCLBYTES\n");
+     return 0;
+@@ -203,7 +209,7 @@ int packet(void *packet_arg, struct mbuf **packet_mp, 
+   // packet content:
+   // IPv6 header + ICMPv6 Neighbor Advertisement including target address + target link-layer ICMPv6 address option
+   mreply->m_pkthdr.len = mreply->m_len = (sizeof(struct ip6_hdr) + sizeof(struct nd_neighbor_advert)
+-					  + sizeof(struct nd_opt_hdr) + packet_ifnet->if_addrlen + 7) & ~7;
++					  + sizeof(struct nd_opt_hdr) + if_getaddrlen(packet_ifnet) + 7) & ~7;
+ 
+   // reserve space for the link-layer header
+   mreply->m_data += max_linkhdr;