ipvs: stop tot_stats estimator only under CONFIG_SYSCTL
Subsystems (3)
Julian Anastasov
maintainerPATCH 1/1 ipvs: stop tot_stats estimator only under CONFIG_SYSCTL
The tot_stats estimator is started only when CONFIG_SYSCTL is defined. But it is stopped without checking CONFIG_SYSCTL. Fix the crash by moving ip_vs_stop_estimator into ip_vs_control_net_cleanup_sysctl.
The change is needed after commit 14e405461e664b ("IPVS: Add __ip_vs_control_{init,cleanup}_sysctl()") from 2.6.39.
Reported-by Jet Chen <[email protected]>
Tested-by Jet Chen <[email protected]>
Signed-off-by Julian Anastasov <[email protected]>
--- net/netfilter/ipvs/ip_vs_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_ctl.c +1 -1
@@ -3778,6 +3778,7 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net)cancel_delayed_work_sync (&ipvs->defense_work);cancel_work_sync (&ipvs->defense_work.work);unregister_net_sysctl_table (ipvs->sysctl_hdr); + ip_vs_stop_estimator(net, &ipvs->tot_stats); }#else
@@ -3840,7 +3841,6 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net)struct netns_ipvs *ipvs =net_ipvs (net);ip_vs_trash_cleanup (net); -ip_vs_stop_estimator (net, &ipvs->tot_stats);ip_vs_control_net_cleanup_sysctl (net);remove_proc_entry ("ip_vs_stats_percpu" , net->proc_net);remove_proc_entry ("ip_vs_stats" , net->proc_net);
Signature · 1 line
1.9.0