kernel: bump 5.15 to 5.15.157
[openwrt/openwrt.git] / target / linux / generic / pending-5.15 / 700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
index 8c7555403383214e4590fdac3613f0188e7b27a0..ba75e4a0f1043361878fb621c2b886ea409760d0 100644 (file)
@@ -10,9 +10,9 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
 
 --- a/net/netfilter/nf_flow_table_core.c
 +++ b/net/netfilter/nf_flow_table_core.c
-@@ -606,13 +606,41 @@ void nf_flow_table_free(struct nf_flowta
- }
EXPORT_SYMBOL_GPL(nf_flow_table_free);
+@@ -651,6 +651,23 @@ static struct pernet_operations nf_flow_
+       .exit_batch = nf_flow_table_pernet_exit,
};
  
 +static int nf_flow_table_netdev_event(struct notifier_block *this,
 +                                    unsigned long event, void *ptr)
@@ -33,26 +33,30 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
 +
  static int __init nf_flow_table_module_init(void)
  {
--      return nf_flow_table_offload_init();
-+      int ret;
-+
-+      ret = nf_flow_table_offload_init();
-+      if (ret)
-+              return ret;
-+
+       int ret;
+@@ -663,8 +680,14 @@ static int __init nf_flow_table_module_i
+       if (ret)
+               goto out_offload;
 +      ret = register_netdevice_notifier(&flow_offload_netdev_notifier);
 +      if (ret)
-+              nf_flow_table_offload_exit();
++              goto out_offload_init;
 +
-+      return ret;
- }
+       return 0;
++out_offload_init:
++      nf_flow_table_offload_exit();
+ out_offload:
+       unregister_pernet_subsys(&nf_flow_table_net_ops);
+       return ret;
+@@ -672,6 +695,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);
  }
 --- a/net/netfilter/nft_flow_offload.c
 +++ b/net/netfilter/nft_flow_offload.c
 @@ -455,47 +455,14 @@ static struct nft_expr_type nft_flow_off