From c66627f1ea5b94925078bd972a5db648aebf90fe Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 10 Jun 2022 19:14:49 +0200 Subject: if_wg: account for added argument to sbcreatecontrol Signed-off-by: Jason A. Donenfeld --- src/compat.h | 5 +++++ src/if_wg.c | 4 ++-- 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 +#if __FreeBSD_version < 1400517 +#include +#define sbcreatecontrol(a, b, c, d, e) sbcreatecontrol(a, b, c, d) +#endif + #if __FreeBSD_version < 1300507 #include #include 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); -- cgit v1.2.3-59-g8ed1b