diff --git a/net/wireguard-kmod/Makefile b/net/wireguard-kmod/Makefile index 86f803881f82..178ef6bc3e10 100644 --- a/net/wireguard-kmod/Makefile +++ b/net/wireguard-kmod/Makefile @@ -1,20 +1,21 @@ PORTNAME= wireguard-kmod PORTVERSION= 0.0.20220615 +PORTREVISION= 1 CATEGORIES= net net-vpn MASTER_SITES= https://git.zx2c4.com/wireguard-freebsd/snapshot/ DISTNAME= wireguard-freebsd-${PORTVERSION} MAINTAINER= decke@FreeBSD.org COMMENT= WireGuard implementation for the FreeBSD kernel WWW= https://git.zx2c4.com/wireguard-freebsd/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/../COPYING USES= kmod tar:xz uidfix WRKSRC_SUBDIR= src PLIST_FILES= ${KMODDIR}/if_wg.ko .include diff --git a/net/wireguard-kmod/files/patch-if__wg.c b/net/wireguard-kmod/files/patch-if__wg.c new file mode 100644 index 000000000000..283bbfc7615b --- /dev/null +++ b/net/wireguard-kmod/files/patch-if__wg.c @@ -0,0 +1,32 @@ +Chase udp_tun_func_t typedef change in FreeBSD 14-current (bb77f0) + +Submitted by: Stefan Haller , + Guido Falsi +Obtained from: https://bugs.freebsd.org/266914 +Link: https://freshbsd.org/freebsd/src/commit/bb77f0c2049311f0661c2493838d81a5a66c449c +--- if_wg.c.orig 2022-06-15 14:11:06 UTC ++++ if_wg.c +@@ -693,7 +693,11 @@ wg_socket_init(struct wg_softc *sc, in_port_t port) + if (rc) + goto out; + ++#if __FreeBSD_version >= 1400067 ++ rc = udp_set_kernel_tunneling(so4, wg_input, NULL, sc); ++#else + rc = udp_set_kernel_tunneling(so4, (udp_tun_func_t)wg_input, NULL, sc); ++#endif + /* + * udp_set_kernel_tunneling can only fail if there is already a tunneling function set. + * This should never happen with a new socket. +@@ -704,7 +708,11 @@ wg_socket_init(struct wg_softc *sc, in_port_t port) + rc = socreate(AF_INET6, &so6, SOCK_DGRAM, IPPROTO_UDP, cred, td); + if (rc) + goto out; ++#if __FreeBSD_version >= 1400067 ++ rc = udp_set_kernel_tunneling(so6, wg_input, NULL, sc); ++#else + rc = udp_set_kernel_tunneling(so6, (udp_tun_func_t)wg_input, NULL, sc); ++#endif + MPASS(rc == 0); + #endif +