aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-06-10 19:14:49 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2022-06-10 19:16:09 +0200
commitc66627f1ea5b94925078bd972a5db648aebf90fe (patch)
tree67b9094afe7c7a5457f4a983379fba3719d48cb6
parentcrypto: return an error code from mbuf crypt routines (diff)
downloadwireguard-freebsd-c66627f1ea5b94925078bd972a5db648aebf90fe.tar.xz
wireguard-freebsd-c66627f1ea5b94925078bd972a5db648aebf90fe.zip
if_wg: account for added argument to sbcreatecontrol
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/compat.h5
-rw-r--r--src/if_wg.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/compat.h b/src/compat.h
index f5b7059..dfc7120 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -8,6 +8,11 @@
#include <sys/param.h>
+#if __FreeBSD_version < 1400517
+#include <sys/sockbuf.h>
+#define sbcreatecontrol(a, b, c, d, e) sbcreatecontrol(a, b, c, d)
+#endif
+
#if __FreeBSD_version < 1300507
#include <sys/smp.h>
#include <sys/gtaskqueue.h>
diff --git a/src/if_wg.c b/src/if_wg.c
index fffdf8d..bbcaafe 100644
--- a/src/if_wg.c
+++ b/src/if_wg.c
@@ -895,13 +895,13 @@ wg_send(struct wg_softc *sc, struct wg_endpoint *e, struct mbuf *m)
if (e->e_local.l_in.s_addr != INADDR_ANY)
control = sbcreatecontrol((caddr_t)&e->e_local.l_in,
sizeof(struct in_addr), IP_SENDSRCADDR,
- IPPROTO_IP);
+ IPPROTO_IP, M_NOWAIT);
#ifdef INET6
} else if (e->e_remote.r_sa.sa_family == AF_INET6) {
if (!IN6_IS_ADDR_UNSPECIFIED(&e->e_local.l_in6))
control = sbcreatecontrol((caddr_t)&e->e_local.l_pktinfo6,
sizeof(struct in6_pktinfo), IPV6_PKTINFO,
- IPPROTO_IPV6);
+ IPPROTO_IPV6, M_NOWAIT);
#endif
} else {
m_freem(m);