--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
-@@ -608,28 +608,52 @@ void nf_flow_table_free(struct nf_flowta
+@@ -659,6 +659,23 @@ static struct pernet_operations nf_flow_
.exit_batch = nf_flow_table_pernet_exit,
};
static int __init nf_flow_table_module_init(void)
{
int ret;
-
- ret = register_pernet_subsys(&nf_flow_table_net_ops);
- if (ret < 0)
- return ret;
-
- ret = nf_flow_table_offload_init();
+@@ -671,8 +688,14 @@ static int __init nf_flow_table_module_i
if (ret)
goto out_offload;
-+
+
+ ret = register_netdevice_notifier(&flow_offload_netdev_notifier);
+ if (ret)
+ goto out_offload_init;
-
++
return 0;
+out_offload_init:
out_offload:
unregister_pernet_subsys(&nf_flow_table_net_ops);
return ret;
- }
+@@ -680,6 +703,7 @@ out_offload:
static void __exit nf_flow_table_module_exit(void)
{
+ unregister_netdevice_notifier(&flow_offload_netdev_notifier);
nf_flow_table_offload_exit();
- unregister_pernet_subsys(&nf_flow_table_net_ops);
+ unregister_pernet_subsys(&nf_flow_table_net_ops);
}
-
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
-@@ -444,47 +444,14 @@ static struct nft_expr_type nft_flow_off
+@@ -479,47 +479,14 @@ static struct nft_expr_type nft_flow_off
.owner = THIS_MODULE,
};