diff --git a/net/netfilter/xt_FLOWOFFLOAD.c b/net/netfilter/xt_FLOWOFFLOAD.c
index 10e6c5acb89c3944b42690c244f04b2de90c1929..e00f9f34b12ca6547182d119b6ddfeec03ca557a 100644
--- a/net/netfilter/xt_FLOWOFFLOAD.c
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
@@ -14,6 +14,7 @@
#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_conntrack_helper.h>
#include <net/netfilter/nf_flow_table.h>
+#include <linux/proc_fs.h>
static struct nf_flowtable nf_flowtable;
static HLIST_HEAD(hooks);
@@ -392,10 +393,40 @@ static struct notifier_block flow_offload_netdev_notifier = {
.notifier_call = flow_offload_netdev_event,
};
+static struct proc_dir_entry *procfs_subdir_entry;
+
+static ssize_t procfs_callback(struct file *f, const char __user *u,
+ size_t count, loff_t *p)
+{
+ nf_flow_table_cleanup(NULL, NULL);
+ return count;
+}
+
+#define PROC_SUBDIR "nf-flow-table-control"
+#define PROC_ACTION "clear"
+
+static void register_flow_table_ctrl(void)
+{
+ static struct file_operations ops = {
+ .owner = THIS_MODULE,
+ .write = procfs_callback
+ };
+
+ procfs_subdir_entry = proc_mkdir(PROC_SUBDIR, NULL);
+ proc_create(PROC_ACTION, 0220, procfs_subdir_entry, &ops);
+}
+
+static void unregister_flow_table_ctrl(void)
+{
+ remove_proc_entry(PROC_ACTION, procfs_subdir_entry);
+ remove_proc_entry(PROC_SUBDIR, NULL);
+}
+
static int __init xt_flowoffload_tg_init(void)
{
int ret;
+ register_flow_table_ctrl();
register_netdevice_notifier(&flow_offload_netdev_notifier);
INIT_DELAYED_WORK(&hook_work, xt_flowoffload_hook_work);
@@ -415,6 +446,7 @@ static void __exit xt_flowoffload_tg_exit(void)
{
xt_unregister_target(&offload_tg_reg);
xt_flowoffload_table_cleanup(&nf_flowtable);
+ unregister_flow_table_ctrl();
unregister_netdevice_notifier(&flow_offload_netdev_notifier);
}