diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-25 18:50:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-25 18:50:32 -0400 |
commit | e486463e82e4dca9e8f4413649088b21c9ff87e5 (patch) | |
tree | 3fb17b54454a101416c2b22e6b4ea5a027b3c02b /net/ipv6/route.c | |
parent | ed3b856b69a7f3748d6917e42d462c962aaa39b8 (diff) | |
parent | fa809e2fd6e317226c046202a88520962672eac0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/usb/qmi_wwan.c
net/batman-adv/translation-table.c
net/ipv6/route.c
qmi_wwan.c resolution provided by Bjørn Mork.
batman-adv conflict is dealing merely with the changes
of global function names to have a proper subsystem
prefix.
ipv6's route.c conflict is merely two side-by-side additions
of network namespace methods.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e649cd78c15f..c5bbece7f9f2 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2888,10 +2888,6 @@ static int __net_init ip6_route_net_init(struct net *net) | |||
2888 | net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; | 2888 | net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; |
2889 | net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; | 2889 | net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; |
2890 | 2890 | ||
2891 | #ifdef CONFIG_PROC_FS | ||
2892 | proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops); | ||
2893 | proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); | ||
2894 | #endif | ||
2895 | net->ipv6.ip6_rt_gc_expire = 30*HZ; | 2891 | net->ipv6.ip6_rt_gc_expire = 30*HZ; |
2896 | 2892 | ||
2897 | ret = 0; | 2893 | ret = 0; |
@@ -2912,10 +2908,6 @@ out_ip6_dst_ops: | |||
2912 | 2908 | ||
2913 | static void __net_exit ip6_route_net_exit(struct net *net) | 2909 | static void __net_exit ip6_route_net_exit(struct net *net) |
2914 | { | 2910 | { |
2915 | #ifdef CONFIG_PROC_FS | ||
2916 | proc_net_remove(net, "ipv6_route"); | ||
2917 | proc_net_remove(net, "rt6_stats"); | ||
2918 | #endif | ||
2919 | kfree(net->ipv6.ip6_null_entry); | 2911 | kfree(net->ipv6.ip6_null_entry); |
2920 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 2912 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
2921 | kfree(net->ipv6.ip6_prohibit_entry); | 2913 | kfree(net->ipv6.ip6_prohibit_entry); |
@@ -2924,6 +2916,23 @@ static void __net_exit ip6_route_net_exit(struct net *net) | |||
2924 | dst_entries_destroy(&net->ipv6.ip6_dst_ops); | 2916 | dst_entries_destroy(&net->ipv6.ip6_dst_ops); |
2925 | } | 2917 | } |
2926 | 2918 | ||
2919 | static int __net_init ip6_route_net_init_late(struct net *net) | ||
2920 | { | ||
2921 | #ifdef CONFIG_PROC_FS | ||
2922 | proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops); | ||
2923 | proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); | ||
2924 | #endif | ||
2925 | return 0; | ||
2926 | } | ||
2927 | |||
2928 | static void __net_exit ip6_route_net_exit_late(struct net *net) | ||
2929 | { | ||
2930 | #ifdef CONFIG_PROC_FS | ||
2931 | proc_net_remove(net, "ipv6_route"); | ||
2932 | proc_net_remove(net, "rt6_stats"); | ||
2933 | #endif | ||
2934 | } | ||
2935 | |||
2927 | static struct pernet_operations ip6_route_net_ops = { | 2936 | static struct pernet_operations ip6_route_net_ops = { |
2928 | .init = ip6_route_net_init, | 2937 | .init = ip6_route_net_init, |
2929 | .exit = ip6_route_net_exit, | 2938 | .exit = ip6_route_net_exit, |
@@ -2954,6 +2963,11 @@ static struct pernet_operations ipv6_inetpeer_ops = { | |||
2954 | .exit = ipv6_inetpeer_exit, | 2963 | .exit = ipv6_inetpeer_exit, |
2955 | }; | 2964 | }; |
2956 | 2965 | ||
2966 | static struct pernet_operations ip6_route_net_late_ops = { | ||
2967 | .init = ip6_route_net_init_late, | ||
2968 | .exit = ip6_route_net_exit_late, | ||
2969 | }; | ||
2970 | |||
2957 | static struct notifier_block ip6_route_dev_notifier = { | 2971 | static struct notifier_block ip6_route_dev_notifier = { |
2958 | .notifier_call = ip6_route_dev_notify, | 2972 | .notifier_call = ip6_route_dev_notify, |
2959 | .priority = 0, | 2973 | .priority = 0, |
@@ -3007,19 +3021,25 @@ int __init ip6_route_init(void) | |||
3007 | if (ret) | 3021 | if (ret) |
3008 | goto xfrm6_init; | 3022 | goto xfrm6_init; |
3009 | 3023 | ||
3024 | ret = register_pernet_subsys(&ip6_route_net_late_ops); | ||
3025 | if (ret) | ||
3026 | goto fib6_rules_init; | ||
3027 | |||
3010 | ret = -ENOBUFS; | 3028 | ret = -ENOBUFS; |
3011 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || | 3029 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || |
3012 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || | 3030 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || |
3013 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) | 3031 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) |
3014 | goto fib6_rules_init; | 3032 | goto out_register_late_subsys; |
3015 | 3033 | ||
3016 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); | 3034 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); |
3017 | if (ret) | 3035 | if (ret) |
3018 | goto fib6_rules_init; | 3036 | goto out_register_late_subsys; |
3019 | 3037 | ||
3020 | out: | 3038 | out: |
3021 | return ret; | 3039 | return ret; |
3022 | 3040 | ||
3041 | out_register_late_subsys: | ||
3042 | unregister_pernet_subsys(&ip6_route_net_late_ops); | ||
3023 | fib6_rules_init: | 3043 | fib6_rules_init: |
3024 | fib6_rules_cleanup(); | 3044 | fib6_rules_cleanup(); |
3025 | xfrm6_init: | 3045 | xfrm6_init: |
@@ -3040,6 +3060,7 @@ out_kmem_cache: | |||
3040 | void ip6_route_cleanup(void) | 3060 | void ip6_route_cleanup(void) |
3041 | { | 3061 | { |
3042 | unregister_netdevice_notifier(&ip6_route_dev_notifier); | 3062 | unregister_netdevice_notifier(&ip6_route_dev_notifier); |
3063 | unregister_pernet_subsys(&ip6_route_net_late_ops); | ||
3043 | fib6_rules_cleanup(); | 3064 | fib6_rules_cleanup(); |
3044 | xfrm6_fini(); | 3065 | xfrm6_fini(); |
3045 | fib6_gc_cleanup(); | 3066 | fib6_gc_cleanup(); |