FreeBSD Bugzilla – Attachment 233525 Details for
Bug 263297
[netinet] [742e721] Changes in udp_tun_func_t() breaks if_wg from net/wireguard-kmod
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Improved patch for if_wg.c, differentiating between the new and the old behaviour, now adhering to the makepatch format
patch-if__wg.c (text/plain), 2.28 KB, created by
Trond Endrestøl
on 2022-04-27 06:46:02 UTC
(
hide
)
Description:
Improved patch for if_wg.c, differentiating between the new and the old behaviour, now adhering to the makepatch format
Filename:
MIME Type:
Creator:
Trond Endrestøl
Created:
2022-04-27 06:46:02 UTC
Size:
2.28 KB
patch
obsolete
>--- if_wg.c.orig 2021-11-05 14:40:17 UTC >+++ if_wg.c >@@ -377,7 +377,11 @@ static void wg_queue_purge(struct wg_queue *); > 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 *); >+#if __FreeBSD_version >= 1400057 >+static bool wg_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); >+#else > static void wg_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); >+#endif > 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,8 +1950,13 @@ wg_queue_dequeue_parallel(struct wg_queue *parallel) > return (pkt); > } > >+#if __FreeBSD_version >= 1400057 > static void > wg_input(struct mbuf *m, int offset, struct inpcb *inpcb, >+#else >+static void >+wg_input(struct mbuf *m, int offset, struct inpcb *inpcb, >+#endif > const struct sockaddr *sa, void *_sc) > { > const struct sockaddr_in *sin; >@@ -1965,7 +1974,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); >+#if __FreeBSD_version >= 1400057 >+ return true; >+#else > return; >+#endif > } > > /* Caller provided us with `sa`, no need for this header. */ >@@ -1974,13 +1987,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); >+#if __FreeBSD_version >= 1400057 >+ return true; >+#else > return; >+#endif > } > > if ((pkt = wg_packet_alloc(m)) == NULL) { > if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); > m_freem(m); >+#if __FreeBSD_version >= 1400057 >+ return true; >+#else > return; >+#endif > } > > /* Save send/recv address and port for later. */ >@@ -2027,11 +2048,19 @@ wg_input(struct mbuf *m, int offset, struct inpcb *inp > } else { > goto error; > } >+#if __FreeBSD_version >= 1400057 >+ return true; >+#else > return; >+#endif > error: > if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); > wg_packet_free(pkt); >+#if __FreeBSD_version >= 1400057 >+ return true; >+#else > return; >+#endif > } > > static void
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 263297
:
233478
|
233513
|
233516
|
233522
|
233523
|
233524
|
233525
|
233628
|
233630