aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 22:39:08 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 22:41:07 -0600
commita520a799ba6e39b1e1574b605dcc3a13d360e5bc (patch)
treeab6b5cc0b7759a8618d5819b6c7becb07b3dd70d
parentif_wg: remove M_WAITOK, check return codes on init (diff)
downloadwireguard-freebsd-a520a799ba6e39b1e1574b605dcc3a13d360e5bc.tar.xz
wireguard-freebsd-a520a799ba6e39b1e1574b605dcc3a13d360e5bc.zip
compat: backport m_snd_tag_rele to 12
This doesn't add any reference counting, opting instead to go right to the free. This could cause problems, but hopefully not. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h
index d173eb2..00ab0d8 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -67,6 +67,17 @@ static inline void taskqgroup_drain_all(struct taskqgroup *tqg)
#undef atomic_load_ptr
#define atomic_load_ptr(p) (*(volatile __typeof(*p) *)(p))
+
+static inline void m_snd_tag_rele(struct m_snd_tag *mst)
+{
+ struct ifnet *ifp;
+ if (!mst)
+ return;
+ ifp = mst->ifp;
+ ifp->if_snd_tag_free(mst);
+ if_rele(ifp);
+}
+
#endif
#if __FreeBSD_version < 1202000