Skip to content

Commit fe0a9f0

Browse files
committed
prevent the delay to charge the netfilter alarm
1 parent 67dd01d commit fe0a9f0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/proc_net_stat_conntrack.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
2121

2222
snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/sys/net/netfilter/nf_conntrack_max");
2323
nf_conntrack_max_filename = config_get("plugin:proc:/proc/sys/net/netfilter/nf_conntrack_max", "filename to monitor", filename);
24-
get_max_every = config_get_number("plugin:proc:/proc/sys/net/netfilter/nf_conntrack_max", "read every seconds", 10) * 1000000ULL;
24+
usec_since_last_max = get_max_every = config_get_number("plugin:proc:/proc/sys/net/netfilter/nf_conntrack_max", "read every seconds", 10) * 1000000ULL;
2525

2626
read_full = 1;
2727
ff = procfile_open(nf_conntrack_filename, " \t:", PROCFILE_FLAG_DEFAULT);
@@ -117,7 +117,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
117117
}
118118

119119
usec_since_last_max += dt;
120-
if(unlikely(rrdvar_max && usec_since_last_max > get_max_every)) {
120+
if(unlikely(rrdvar_max && usec_since_last_max >= get_max_every)) {
121121
usec_since_last_max = 0;
122122

123123
unsigned long long max;

0 commit comments

Comments
 (0)