[PATCH 08/15] header: add inet_frags_uninit_net()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



inet_frags_uninit_net() was added in commit 1d6119baf06 "net: fix
percpu memory leaks" and is used by the 6lowpan part of ieee802154 in
backports.

percpu_counter_destroy() was added in kernel 3.9, so do not add this
function on older kernel versions. This is currently only used by the
6lowpan part of ieee802154 which is only activated for kernel >= 3.18.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/net/inet_frag.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/net/inet_frag.h b/backport/backport-include/net/inet_frag.h
index e36224e..f6bc6f1 100644
--- a/backport/backport-include/net/inet_frag.h
+++ b/backport/backport-include/net/inet_frag.h
@@ -55,4 +55,13 @@ static inline void add_frag_mem_limit(struct netns_frags *nf, int i)
 }
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) && \
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
+#define inet_frags_uninit_net LINUX_BACKPORT(inet_frags_uninit_net)
+static inline void inet_frags_uninit_net(struct netns_frags *nf)
+{
+	percpu_counter_destroy(&nf->mem);
+}
+#endif /* < 4.4 && >= 3.9 */
+
 #endif /* __BACKPORT__NET_FRAG_H__ */
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux