]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/netfilter/nf_tables_api.c
netfilter: nf_tables: increase nft_counters_enabled in nft_chain_stats_replace()
[linux.git] / net / netfilter / nf_tables_api.c
index 2bdc8767aa40101b9b443da8c96ddb66a876606e..501e48a7965b4a1de0e71a2e7bda1ad9daf3f15d 100644 (file)
@@ -1298,8 +1298,10 @@ static void nft_chain_stats_replace(struct nft_base_chain *chain,
                rcu_assign_pointer(chain->stats, newstats);
                synchronize_rcu();
                free_percpu(oldstats);
-       } else
+       } else {
                rcu_assign_pointer(chain->stats, newstats);
+               static_branch_inc(&nft_counters_enabled);
+       }
 }
 
 static void nf_tables_chain_destroy(struct nft_ctx *ctx)