Commit 44cca8a2 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji Committed by David S. Miller

[IPV6]: Add ip6frag sysctls.

parent 5a6f7f28
...@@ -366,7 +366,11 @@ enum { ...@@ -366,7 +366,11 @@ enum {
NET_IPV6_NEIGH=17, NET_IPV6_NEIGH=17,
NET_IPV6_ROUTE=18, NET_IPV6_ROUTE=18,
NET_IPV6_ICMP=19, NET_IPV6_ICMP=19,
NET_IPV6_BINDV6ONLY=20 NET_IPV6_BINDV6ONLY=20,
NET_IPV6_IP6FRAG_HIGH_THRESH=21,
NET_IPV6_IP6FRAG_LOW_THRESH=22,
NET_IPV6_IP6FRAG_TIME=23,
NET_IPV6_IP6FRAG_SECRET_INTERVAL=24
}; };
enum { enum {
......
...@@ -406,6 +406,14 @@ extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -406,6 +406,14 @@ extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
extern int inet6_ioctl(struct socket *sock, unsigned int cmd, extern int inet6_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg); unsigned long arg);
/*
* reassembly.c
*/
extern int sysctl_ip6frag_high_thresh;
extern int sysctl_ip6frag_low_thresh;
extern int sysctl_ip6frag_time;
extern int sysctl_ip6frag_secret_interval;
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _NET_IPV6_H */ #endif /* _NET_IPV6_H */
......
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
#include <net/ndisc.h> #include <net/ndisc.h>
#include <net/addrconf.h> #include <net/addrconf.h>
static int sysctl_ip6frag_high_thresh = 256*1024; int sysctl_ip6frag_high_thresh = 256*1024;
static int sysctl_ip6frag_low_thresh = 192*1024; int sysctl_ip6frag_low_thresh = 192*1024;
static int sysctl_ip6frag_time = IPV6_FRAG_TIMEOUT; int sysctl_ip6frag_time = IPV6_FRAG_TIMEOUT;
struct ip6frag_skb_cb struct ip6frag_skb_cb
{ {
...@@ -152,7 +152,7 @@ static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr, ...@@ -152,7 +152,7 @@ static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr,
} }
static struct timer_list ip6_frag_secret_timer; static struct timer_list ip6_frag_secret_timer;
static int ip6_frag_secret_interval = 10 * 60 * HZ; int sysctl_ip6frag_secret_interval = 10 * 60 * HZ;
static void ip6_frag_secret_rebuild(unsigned long dummy) static void ip6_frag_secret_rebuild(unsigned long dummy)
{ {
...@@ -189,7 +189,7 @@ static void ip6_frag_secret_rebuild(unsigned long dummy) ...@@ -189,7 +189,7 @@ static void ip6_frag_secret_rebuild(unsigned long dummy)
} }
write_unlock(&ip6_frag_lock); write_unlock(&ip6_frag_lock);
mod_timer(&ip6_frag_secret_timer, now + ip6_frag_secret_interval); mod_timer(&ip6_frag_secret_timer, now + sysctl_ip6frag_secret_interval);
} }
atomic_t ip6_frag_mem = ATOMIC_INIT(0); atomic_t ip6_frag_mem = ATOMIC_INIT(0);
...@@ -755,6 +755,6 @@ void __init ipv6_frag_init(void) ...@@ -755,6 +755,6 @@ void __init ipv6_frag_init(void)
init_timer(&ip6_frag_secret_timer); init_timer(&ip6_frag_secret_timer);
ip6_frag_secret_timer.function = ip6_frag_secret_rebuild; ip6_frag_secret_timer.function = ip6_frag_secret_rebuild;
ip6_frag_secret_timer.expires = jiffies + ip6_frag_secret_interval; ip6_frag_secret_timer.expires = jiffies + sysctl_ip6frag_secret_interval;
add_timer(&ip6_frag_secret_timer); add_timer(&ip6_frag_secret_timer);
} }
...@@ -42,6 +42,40 @@ ctl_table ipv6_table[] = { ...@@ -42,6 +42,40 @@ ctl_table ipv6_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = &proc_dointvec
}, },
{
.ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
.procname = "ip6frag_high_thresh",
.data = &sysctl_ip6frag_high_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
.procname = "ip6frag_low_thresh",
.data = &sysctl_ip6frag_low_thresh,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{
.ctl_name = NET_IPV6_IP6FRAG_TIME,
.procname = "ip6frag_time",
.data = &sysctl_ip6frag_time,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
},
{
.ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
.procname = "ip6frag_secret_interval",
.data = &sysctl_ip6frag_secret_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies
},
{ .ctl_name = 0 } { .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