FreeBSD Bugzilla – Attachment 234232 Details for
Bug 264105
net/wireguard-kmod: Breakage on HEAD since improvement in sbcreatecontrol() of sockbuf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Alternative patch, using #define for sbcreatecontrol_now()
net__wireguard-kmod-fix-sbcreatecontrol-1.diff (text/plain), 3.45 KB, created by
Dimitry Andric
on 2022-05-26 13:11:15 UTC
(
hide
)
Description:
Alternative patch, using #define for sbcreatecontrol_now()
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2022-05-26 13:11:15 UTC
Size:
3.45 KB
patch
obsolete
>commit cd7bcdb33dd5021e81781cdc79d2ceabd019d886 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: Thu May 26 15:04:39 2022 +0200 > > net/wireguard-kmod: fix compile after sbcreatecontrol() API change > >diff --git a/net/wireguard-kmod/files/patch-if_wg.c b/net/wireguard-kmod/files/patch-if_wg.c >index 6ba4437fc116..533a743dc5e1 100644 >--- a/net/wireguard-kmod/files/patch-if_wg.c >+++ b/net/wireguard-kmod/files/patch-if_wg.c >@@ -1,6 +1,17 @@ > --- if_wg.c.orig 2021-11-05 14:40:17 UTC > +++ if_wg.c >-@@ -377,7 +377,11 @@ static struct wg_packet *wg_queue_dequeue_parallel(str >+@@ -93,6 +93,10 @@ __FBSDID("$FreeBSD$"); >+ >+ #define DPRINTF(sc, ...) if (sc->sc_ifp->if_flags & IFF_DEBUG) if_printf(sc->sc_ifp, ##__VA_ARGS__) >+ >++#if __FreeBSD_version >= 1400059 >++#define sbcreatecontrol_how(p, size, type, level, wait) sbcreatecontrol(p, size, type, level, wait) >++#endif >++ >+ /* First byte indicating packet type on the wire */ >+ #define WG_PKT_INITIATION htole32(1) >+ #define WG_PKT_RESPONSE htole32(2) >+@@ -377,7 +381,11 @@ static struct wg_packet *wg_queue_dequeue_parallel(str > static int wg_queue_both(struct wg_queue *, struct wg_queue *, struct wg_packet *); > static struct wg_packet *wg_queue_dequeue_serial(struct wg_queue *); > static struct wg_packet *wg_queue_dequeue_parallel(struct wg_queue *); >@@ -12,7 +23,27 @@ > static void wg_peer_send_staged(struct wg_peer *); > static int wg_clone_create(struct if_clone *, int, caddr_t); > static void wg_qflush(struct ifnet *); >-@@ -1946,9 +1950,15 @@ wg_queue_dequeue_parallel(struct wg_queue *parallel) >+@@ -891,15 +899,15 @@ wg_send(struct wg_softc *sc, struct wg_endpoint *e, st >+ /* Get local control address before locking */ >+ if (e->e_remote.r_sa.sa_family == AF_INET) { >+ if (e->e_local.l_in.s_addr != INADDR_ANY) >+- control = sbcreatecontrol((caddr_t)&e->e_local.l_in, >++ control = sbcreatecontrol_how((caddr_t)&e->e_local.l_in, >+ sizeof(struct in_addr), IP_SENDSRCADDR, >+- IPPROTO_IP); >++ IPPROTO_IP, M_WAITOK); >+ #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, >++ control = sbcreatecontrol_how((caddr_t)&e->e_local.l_pktinfo6, >+ sizeof(struct in6_pktinfo), IPV6_PKTINFO, >+- IPPROTO_IPV6); >++ IPPROTO_IPV6, M_WAITOK); >+ #endif >+ } else { >+ m_freem(m); >+@@ -1946,9 +1954,15 @@ wg_queue_dequeue_parallel(struct wg_queue *parallel) > return (pkt); > } > >@@ -28,7 +59,7 @@ > { > const struct sockaddr_in *sin; > const struct sockaddr_in6 *sin6; >-@@ -1965,7 +1975,11 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp >+@@ -1965,7 +1979,11 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp > m = m_unshare(m, M_NOWAIT); > if (!m) { > if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); >@@ -40,7 +71,7 @@ > } > > /* Caller provided us with `sa`, no need for this header. */ >-@@ -1974,13 +1988,21 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp >+@@ -1974,13 +1992,21 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp > /* Pullup enough to read packet type */ > if ((m = m_pullup(m, sizeof(uint32_t))) == NULL) { > if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); >@@ -62,7 +93,7 @@ > } > > /* Save send/recv address and port for later. */ >-@@ -2027,11 +2049,19 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp >+@@ -2027,11 +2053,19 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp > } else { > goto error; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264105
:
234075
| 234232 |
234331