aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c66
1 files changed, 63 insertions, 3 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 4dfcddc871ce..1815ff0cf628 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -625,12 +625,70 @@ static struct inet6_protocol frag_protocol =
625 .flags = INET6_PROTO_NOPOLICY, 625 .flags = INET6_PROTO_NOPOLICY,
626}; 626};
627 627
628void ipv6_frag_sysctl_init(struct net *net) 628#ifdef CONFIG_SYSCTL
629static struct ctl_table ip6_frags_ctl_table[] = {
630 {
631 .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
632 .procname = "ip6frag_high_thresh",
633 .data = &init_net.ipv6.sysctl.frags.high_thresh,
634 .maxlen = sizeof(int),
635 .mode = 0644,
636 .proc_handler = &proc_dointvec
637 },
638 {
639 .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
640 .procname = "ip6frag_low_thresh",
641 .data = &init_net.ipv6.sysctl.frags.low_thresh,
642 .maxlen = sizeof(int),
643 .mode = 0644,
644 .proc_handler = &proc_dointvec
645 },
646 {
647 .ctl_name = NET_IPV6_IP6FRAG_TIME,
648 .procname = "ip6frag_time",
649 .data = &init_net.ipv6.sysctl.frags.timeout,
650 .maxlen = sizeof(int),
651 .mode = 0644,
652 .proc_handler = &proc_dointvec_jiffies,
653 .strategy = &sysctl_jiffies,
654 },
655 {
656 .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
657 .procname = "ip6frag_secret_interval",
658 .data = &init_net.ipv6.sysctl.frags.secret_interval,
659 .maxlen = sizeof(int),
660 .mode = 0644,
661 .proc_handler = &proc_dointvec_jiffies,
662 .strategy = &sysctl_jiffies
663 },
664 { }
665};
666
667static int ip6_frags_sysctl_register(struct net *net)
668{
669 struct ctl_table_header *hdr;
670
671 hdr = register_net_sysctl_table(net, net_ipv6_ctl_path,
672 ip6_frags_ctl_table);
673 return hdr == NULL ? -ENOMEM : 0;
674}
675#else
676static inline int ip6_frags_sysctl_register(struct net *net)
629{ 677{
630 if (net != &init_net) 678 return 0;
631 return; 679}
680#endif
632 681
682static int ipv6_frags_init_net(struct net *net)
683{
633 ip6_frags.ctl = &net->ipv6.sysctl.frags; 684 ip6_frags.ctl = &net->ipv6.sysctl.frags;
685
686 net->ipv6.sysctl.frags.high_thresh = 256 * 1024;
687 net->ipv6.sysctl.frags.low_thresh = 192 * 1024;
688 net->ipv6.sysctl.frags.timeout = IPV6_FRAG_TIMEOUT;
689 net->ipv6.sysctl.frags.secret_interval = 10 * 60 * HZ;
690
691 return ip6_frags_sysctl_register(net);
634} 692}
635 693
636int __init ipv6_frag_init(void) 694int __init ipv6_frag_init(void)
@@ -641,6 +699,8 @@ int __init ipv6_frag_init(void)
641 if (ret) 699 if (ret)
642 goto out; 700 goto out;
643 701
702 ipv6_frags_init_net(&init_net);
703
644 ip6_frags.hashfn = ip6_hashfn; 704 ip6_frags.hashfn = ip6_hashfn;
645 ip6_frags.constructor = ip6_frag_init; 705 ip6_frags.constructor = ip6_frag_init;
646 ip6_frags.destructor = NULL; 706 ip6_frags.destructor = NULL;