aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Froehlich <decke@FreeBSD.org>2022-12-21 14:00:26 +0000
committerBernhard Froehlich <decke@FreeBSD.org>2022-12-21 14:00:26 +0000
commit17a45735bde9d35b8bbdf2c72145573d8b8abf09 (patch)
treee5fd525854af15c03cb526555a9086196a1e1fbe
parentee03c16bf5d1bd89b15dfa430d66b5cfae263130 (diff)
downloadports-17a45735bde9d35b8bbdf2c72145573d8b8abf09.tar.gz
ports-17a45735bde9d35b8bbdf2c72145573d8b8abf09.zip
net/wireguard-kmod: Chase udp_tun_func_t typedef change in FreeBSD 14-current (bb77f0)
PR: 266914 Submitted by: Stefan Haller <stefan+freebsd@stha.de>, Guido Falsi <madpilot@FreeBSD.org>
-rw-r--r--net/wireguard-kmod/Makefile1
-rw-r--r--net/wireguard-kmod/files/patch-if__wg.c32
2 files changed, 33 insertions, 0 deletions
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,5 +1,6 @@
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}
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 <stefan+freebsd@stha.de>,
+ Guido Falsi <madpilot@FreeBSD.org>
+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
+