diff --git a/net/ndproxy/Makefile b/net/ndproxy/Makefile index 589a7a91b415..9f28cd533e49 100644 --- a/net/ndproxy/Makefile +++ b/net/ndproxy/Makefile @@ -1,36 +1,34 @@ PORTNAME= ndproxy PORTVERSION= 3.2 DISTVERSIONPREFIX= v CATEGORIES= net MAINTAINER= fbsd.bugzilla@fenyo.net COMMENT= Implementation of IPv6 Neighbor Discovery proxy WWW= http://www.fenyo.net/newweb/ndproxy.html LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN_FreeBSD_14= Requires defunct pa_func - USES= compiler kmod SUB_FILES= pkg-message USE_RC_SUBR= ndproxy USE_GITHUB= yes GH_ACCOUNT= AlexandreFenyo # build for a kernel with 'options VIMAGE' CFLAGS+= -DVIMAGE ${CFLAGS_${CHOSEN_COMPILER_TYPE}} CFLAGS_gcc= -Wno-error=strict-prototypes PLIST_FILES= ${KMODDIR}/${PORTNAME}.ko man/man4/${PORTNAME}.4.gz pre-build: (cd ${BUILD_WRKSRC}; ${MAKE} depend) do-install: ${INSTALL_KLD} ${WRKSRC}/${PORTNAME}.ko ${STAGEDIR}${KMODDIR} ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.4 ${STAGEDIR}${PREFIX}/man/man4/ .include diff --git a/net/ndproxy/files/patch-ndproxy.c b/net/ndproxy/files/patch-ndproxy.c new file mode 100644 index 000000000000..453283283445 --- /dev/null +++ b/net/ndproxy/files/patch-ndproxy.c @@ -0,0 +1,45 @@ +From 9db92ede5e52f50b8a45556c173343f9967c36ad Mon Sep 17 00:00:00 2001 +From: Lorenzo Zolfanelli +Date: Fri, 22 Dec 2023 13:52:19 +0100 +Subject: [PATCH] fix: compatibility with new PFIL version + +Since FreeBSD 14 a new PFIL_VERSION has been introduced with a slight +different data structure definition for `pfil_hook_args`. + +See https://github.com/freebsd/freebsd-src/commit/caf32b260ad46b17a4c1a8ce6383e37ac489f023 +for details of the new PFIL_VERSION implementation. + +With this fix is possible to compile against FreeBSD 14 kernel, and the +pre-processor instruction should assure backwards compatibility. +--- ndproxy.c.orig 2019-02-19 09:43:44 UTC ++++ ndproxy.c +@@ -54,7 +54,7 @@ static pfil_hook_t pfh_hook; + + static pfil_hook_t pfh_hook; + +-static void register_hook() { ++static void register_hook(void) { + struct pfil_hook_args pha; + struct pfil_link_args pla; + +@@ -66,7 +66,11 @@ static void register_hook() { + pha.pa_modname = "ndproxy"; + pha.pa_ruleset = NULL; + pha.pa_rulname = "default-in6"; ++#if PFIL_VERSION > 1 ++ pha.pa_mbuf_chk = packet; ++#else + pha.pa_func = packet; ++#endif + pfh_hook = pfil_add_hook(&pha); + + pla.pa_version = PFIL_VERSION; +@@ -78,7 +82,7 @@ static void register_hook() { + hook_added = true; + } + +-static void unregister_hook() { ++static void unregister_hook(void) { + if (!hook_added) return; + pfil_remove_hook(pfh_hook); + }