Commit 8a15a6c8 authored by David S. Miller's avatar David S. Miller

[IPV4]: Add sysctl to control ipfrag_secret_interval.

parent acbd911d
......@@ -307,7 +307,8 @@ enum
NET_IPV4_ICMP_RATEMASK=90,
NET_TCP_TW_REUSE=91,
NET_TCP_FRTO=92,
NET_TCP_LOW_LATENCY=93
NET_TCP_LOW_LATENCY=93,
NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
};
enum {
......
......@@ -126,7 +126,7 @@ static unsigned int ipqhashfn(u16 id, u32 saddr, u32 daddr, u8 prot)
}
static struct timer_list ipfrag_secret_timer;
static int ipfrag_secret_interval = 10 * 60 * HZ;
int sysctl_ipfrag_secret_interval = 10 * 60 * HZ;
static void ipfrag_secret_rebuild(unsigned long dummy)
{
......@@ -162,7 +162,7 @@ static void ipfrag_secret_rebuild(unsigned long dummy)
}
write_unlock(&ipfrag_lock);
mod_timer(&ipfrag_secret_timer, now + ipfrag_secret_interval);
mod_timer(&ipfrag_secret_timer, now + sysctl_ipfrag_secret_interval);
}
atomic_t ip_frag_mem = ATOMIC_INIT(0); /* Memory used for fragments */
......@@ -672,6 +672,6 @@ void ipfrag_init(void)
init_timer(&ipfrag_secret_timer);
ipfrag_secret_timer.function = ipfrag_secret_rebuild;
ipfrag_secret_timer.expires = jiffies + ipfrag_secret_interval;
ipfrag_secret_timer.expires = jiffies + sysctl_ipfrag_secret_interval;
add_timer(&ipfrag_secret_timer);
}
......@@ -27,6 +27,7 @@ extern int sysctl_icmp_ignore_bogus_error_responses;
extern int sysctl_ipfrag_low_thresh;
extern int sysctl_ipfrag_high_thresh;
extern int sysctl_ipfrag_time;
extern int sysctl_ipfrag_secret_interval;
/* From ip_output.c */
extern int sysctl_ip_dynaddr;
......@@ -572,6 +573,15 @@ ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL,
.procname = "ipfrag_secret_interval",
.data = &sysctl_ipfrag_secret_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies
},
{ .ctl_name = 0 }
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment