diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-22 22:39:08 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-22 22:41:07 -0600 |
commit | a520a799ba6e39b1e1574b605dcc3a13d360e5bc (patch) | |
tree | ab6b5cc0b7759a8618d5819b6c7becb07b3dd70d | |
parent | if_wg: remove M_WAITOK, check return codes on init (diff) | |
download | wireguard-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.h | 11 |
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 |