reassembly.c (2457552d1e6f3183cd93f81c49a8da5fe8bb0e42) | reassembly.c (2c8c1e7297e19bdef3c178c3ea41d898a7716e3e) |
---|---|
1/* 2 * IPv6 fragment reassembly 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on: net/ipv4/ip_fragment.c --- 658 unchanged lines hidden (view full) --- 667 .data = &ip6_frags.secret_interval, 668 .maxlen = sizeof(int), 669 .mode = 0644, 670 .proc_handler = proc_dointvec_jiffies, 671 }, 672 { } 673}; 674 | 1/* 2 * IPv6 fragment reassembly 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on: net/ipv4/ip_fragment.c --- 658 unchanged lines hidden (view full) --- 667 .data = &ip6_frags.secret_interval, 668 .maxlen = sizeof(int), 669 .mode = 0644, 670 .proc_handler = proc_dointvec_jiffies, 671 }, 672 { } 673}; 674 |
675static int ip6_frags_ns_sysctl_register(struct net *net) | 675static int __net_init ip6_frags_ns_sysctl_register(struct net *net) |
676{ 677 struct ctl_table *table; 678 struct ctl_table_header *hdr; 679 680 table = ip6_frags_ns_ctl_table; 681 if (!net_eq(net, &init_net)) { 682 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL); 683 if (table == NULL) --- 13 unchanged lines hidden (view full) --- 697 698err_reg: 699 if (!net_eq(net, &init_net)) 700 kfree(table); 701err_alloc: 702 return -ENOMEM; 703} 704 | 676{ 677 struct ctl_table *table; 678 struct ctl_table_header *hdr; 679 680 table = ip6_frags_ns_ctl_table; 681 if (!net_eq(net, &init_net)) { 682 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL); 683 if (table == NULL) --- 13 unchanged lines hidden (view full) --- 697 698err_reg: 699 if (!net_eq(net, &init_net)) 700 kfree(table); 701err_alloc: 702 return -ENOMEM; 703} 704 |
705static void ip6_frags_ns_sysctl_unregister(struct net *net) | 705static void __net_exit ip6_frags_ns_sysctl_unregister(struct net *net) |
706{ 707 struct ctl_table *table; 708 709 table = net->ipv6.sysctl.frags_hdr->ctl_table_arg; 710 unregister_net_sysctl_table(net->ipv6.sysctl.frags_hdr); 711 if (!net_eq(net, &init_net)) 712 kfree(table); 713} --- 26 unchanged lines hidden (view full) --- 740 return 0; 741} 742 743static inline void ip6_frags_sysctl_unregister(void) 744{ 745} 746#endif 747 | 706{ 707 struct ctl_table *table; 708 709 table = net->ipv6.sysctl.frags_hdr->ctl_table_arg; 710 unregister_net_sysctl_table(net->ipv6.sysctl.frags_hdr); 711 if (!net_eq(net, &init_net)) 712 kfree(table); 713} --- 26 unchanged lines hidden (view full) --- 740 return 0; 741} 742 743static inline void ip6_frags_sysctl_unregister(void) 744{ 745} 746#endif 747 |
748static int ipv6_frags_init_net(struct net *net) | 748static int __net_init ipv6_frags_init_net(struct net *net) |
749{ 750 net->ipv6.frags.high_thresh = 256 * 1024; 751 net->ipv6.frags.low_thresh = 192 * 1024; 752 net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; 753 754 inet_frags_init_net(&net->ipv6.frags); 755 756 return ip6_frags_ns_sysctl_register(net); 757} 758 | 749{ 750 net->ipv6.frags.high_thresh = 256 * 1024; 751 net->ipv6.frags.low_thresh = 192 * 1024; 752 net->ipv6.frags.timeout = IPV6_FRAG_TIMEOUT; 753 754 inet_frags_init_net(&net->ipv6.frags); 755 756 return ip6_frags_ns_sysctl_register(net); 757} 758 |
759static void ipv6_frags_exit_net(struct net *net) | 759static void __net_exit ipv6_frags_exit_net(struct net *net) |
760{ 761 ip6_frags_ns_sysctl_unregister(net); 762 inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); 763} 764 765static struct pernet_operations ip6_frags_ops = { 766 .init = ipv6_frags_init_net, 767 .exit = ipv6_frags_exit_net, --- 44 unchanged lines hidden --- | 760{ 761 ip6_frags_ns_sysctl_unregister(net); 762 inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); 763} 764 765static struct pernet_operations ip6_frags_ops = { 766 .init = ipv6_frags_init_net, 767 .exit = ipv6_frags_exit_net, --- 44 unchanged lines hidden --- |