summaryrefslogtreecommitdiff
path: root/datapath/linux
diff options
context:
space:
mode:
authorGreg Rose <gvrose8192@gmail.com>2017-07-21 16:46:04 -0700
committerJoe Stringer <joe@ovn.org>2017-07-24 11:24:32 -0700
commitac8e3c6d14d2f7eb8b02d023aa95cfb025c601d1 (patch)
tree47abb3c88ea2f48e483333fb2deff073068de16e /datapath/linux
parent67e3ddf1e9ffa79d5b4e6dee691a6344325b4087 (diff)
downloadopenvswitch-ac8e3c6d14d2f7eb8b02d023aa95cfb025c601d1.tar.gz
datapath: introduce nf_conntrack_helper_put function
Upstream commit: commit d91fc59cd77c719f33eda65c194ad8f95a055190 Author: Liping Zhang <zlpnobody@gmail.com> Date: Sun May 7 22:01:55 2017 +0800 netfilter: introduce nf_conntrack_helper_put helper function And convert module_put invocation to nf_conntrack_helper_put, this is prepared for the followup patch, which will add a refcnt for cthelper, so we can reject the deleting request when cthelper is in use. Signed-off-by: Liping Zhang <zlpnobody@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Applied with additional use of HAVE_NF_CONNTRACK_HELPER_PUT compatibility flag defined in acinclude.m4. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'datapath/linux')
-rw-r--r--datapath/linux/Modules.mk1
-rw-r--r--datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h12
2 files changed, 13 insertions, 0 deletions
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index 985ffed45..eec9f2338 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -95,6 +95,7 @@ openvswitch_headers += \
linux/compat/include/net/netfilter/nf_conntrack.h \
linux/compat/include/net/netfilter/nf_conntrack_core.h \
linux/compat/include/net/netfilter/nf_conntrack_expect.h \
+ linux/compat/include/net/netfilter/nf_conntrack_helper.h \
linux/compat/include/net/netfilter/nf_conntrack_labels.h \
linux/compat/include/net/netfilter/nf_conntrack_seqadj.h \
linux/compat/include/net/netfilter/nf_conntrack_zones.h \
diff --git a/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h b/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h
new file mode 100644
index 000000000..19c35cd95
--- /dev/null
+++ b/datapath/linux/compat/include/net/netfilter/nf_conntrack_helper.h
@@ -0,0 +1,12 @@
+#ifndef _NF_CONNTRACK_HELPER_WRAPPER_H
+#define _NF_CONNTRACK_HELPER_WRAPPER_H
+
+#include_next <net/netfilter/nf_conntrack_helper.h>
+
+#ifndef HAVE_NF_CONNTRACK_HELPER_PUT
+static inline void nf_conntrack_helper_put(struct nf_conntrack_helper *helper) {
+ module_put(helper->me);
+}
+#endif
+
+#endif /* _NF_CONNTRACK_HELPER_WRAPPER_H */