aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2010-03-20 19:09:01 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-20 19:09:01 -0400
commite21e8467d3188a36f7f0af0d4b9aae74e23fda0e (patch)
treee830f3669d73a50ef1d96722b37f2f486bf14857 /net/ipv6/addrconf.c
parentbcdd553fd3037d8700082ec4cbb6b25437ea06d6 (diff)
addrconf: checkpatch fixes
Fix some of the checkpatch complaints. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c352
1 files changed, 179 insertions, 173 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index bcb55b78746f..279580eab309 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -81,7 +81,7 @@
81#include <linux/random.h> 81#include <linux/random.h>
82#endif 82#endif
83 83
84#include <asm/uaccess.h> 84#include <linux/uaccess.h>
85#include <asm/unaligned.h> 85#include <asm/unaligned.h>
86 86
87#include <linux/proc_fs.h> 87#include <linux/proc_fs.h>
@@ -97,7 +97,7 @@
97#endif 97#endif
98 98
99#define INFINITY_LIFE_TIME 0xFFFFFFFF 99#define INFINITY_LIFE_TIME 0xFFFFFFFF
100#define TIME_DELTA(a,b) ((unsigned long)((long)(a) - (long)(b))) 100#define TIME_DELTA(a, b) ((unsigned long)((long)(a) - (long)(b)))
101 101
102#ifdef CONFIG_SYSCTL 102#ifdef CONFIG_SYSCTL
103static void addrconf_sysctl_register(struct inet6_dev *idev); 103static void addrconf_sysctl_register(struct inet6_dev *idev);
@@ -249,8 +249,7 @@ static void addrconf_del_timer(struct inet6_ifaddr *ifp)
249 __in6_ifa_put(ifp); 249 __in6_ifa_put(ifp);
250} 250}
251 251
252enum addrconf_timer_t 252enum addrconf_timer_t {
253{
254 AC_NONE, 253 AC_NONE,
255 AC_DAD, 254 AC_DAD,
256 AC_RS, 255 AC_RS,
@@ -270,7 +269,8 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp,
270 case AC_RS: 269 case AC_RS:
271 ifp->timer.function = addrconf_rs_timer; 270 ifp->timer.function = addrconf_rs_timer;
272 break; 271 break;
273 default:; 272 default:
273 break;
274 } 274 }
275 ifp->timer.expires = jiffies + when; 275 ifp->timer.expires = jiffies + when;
276 add_timer(&ifp->timer); 276 add_timer(&ifp->timer);
@@ -325,7 +325,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev)
325#endif 325#endif
326 dev_put(dev); 326 dev_put(dev);
327 if (!idev->dead) { 327 if (!idev->dead) {
328 printk("Freeing alive inet6 device %p\n", idev); 328 pr_warning("Freeing alive inet6 device %p\n", idev);
329 return; 329 return;
330 } 330 }
331 snmp6_free_dev(idev); 331 snmp6_free_dev(idev);
@@ -441,8 +441,10 @@ static struct inet6_dev * ipv6_find_idev(struct net_device *dev)
441 441
442 ASSERT_RTNL(); 442 ASSERT_RTNL();
443 443
444 if ((idev = __in6_dev_get(dev)) == NULL) { 444 idev = __in6_dev_get(dev);
445 if ((idev = ipv6_add_dev(dev)) == NULL) 445 if (!idev) {
446 idev = ipv6_add_dev(dev);
447 if (!idev)
446 return NULL; 448 return NULL;
447 } 449 }
448 450
@@ -544,10 +546,10 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
544 in6_dev_put(ifp->idev); 546 in6_dev_put(ifp->idev);
545 547
546 if (del_timer(&ifp->timer)) 548 if (del_timer(&ifp->timer))
547 printk("Timer is still running, when freeing ifa=%p\n", ifp); 549 pr_notice("Timer is still running, when freeing ifa=%p\n", ifp);
548 550
549 if (!ifp->dead) { 551 if (!ifp->dead) {
550 printk("Freeing alive inet6 address %p\n", ifp); 552 pr_warning("Freeing alive inet6 address %p\n", ifp);
551 return; 553 return;
552 } 554 }
553 dst_release(&ifp->rt->u.dst); 555 dst_release(&ifp->rt->u.dst);
@@ -1225,7 +1227,6 @@ try_nextdev:
1225 in6_ifa_put(hiscore->ifa); 1227 in6_ifa_put(hiscore->ifa);
1226 return 0; 1228 return 0;
1227} 1229}
1228
1229EXPORT_SYMBOL(ipv6_dev_get_saddr); 1230EXPORT_SYMBOL(ipv6_dev_get_saddr);
1230 1231
1231int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 1232int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
@@ -1235,7 +1236,8 @@ int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
1235 int err = -EADDRNOTAVAIL; 1236 int err = -EADDRNOTAVAIL;
1236 1237
1237 rcu_read_lock(); 1238 rcu_read_lock();
1238 if ((idev = __in6_dev_get(dev)) != NULL) { 1239 idev = __in6_dev_get(dev);
1240 if (idev) {
1239 struct inet6_ifaddr *ifp; 1241 struct inet6_ifaddr *ifp;
1240 1242
1241 read_lock_bh(&idev->lock); 1243 read_lock_bh(&idev->lock);
@@ -1725,7 +1727,8 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
1725 1727
1726 ASSERT_RTNL(); 1728 ASSERT_RTNL();
1727 1729
1728 if ((idev = ipv6_find_idev(dev)) == NULL) 1730 idev = ipv6_find_idev(dev);
1731 if (!idev)
1729 return NULL; 1732 return NULL;
1730 1733
1731 /* Add default multicast route */ 1734 /* Add default multicast route */
@@ -2433,7 +2436,8 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
2433 2436
2434 ASSERT_RTNL(); 2437 ASSERT_RTNL();
2435 2438
2436 if ((idev = addrconf_add_dev(dev)) == NULL) { 2439 idev = addrconf_add_dev(dev);
2440 if (!idev) {
2437 printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); 2441 printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
2438 return; 2442 return;
2439 } 2443 }
@@ -2448,7 +2452,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2448 int run_pending = 0; 2452 int run_pending = 0;
2449 int err; 2453 int err;
2450 2454
2451 switch(event) { 2455 switch (event) {
2452 case NETDEV_REGISTER: 2456 case NETDEV_REGISTER:
2453 if (!idev && dev->mtu >= IPV6_MIN_MTU) { 2457 if (!idev && dev->mtu >= IPV6_MIN_MTU) {
2454 idev = ipv6_add_dev(dev); 2458 idev = ipv6_add_dev(dev);
@@ -2500,7 +2504,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2500 run_pending = 1; 2504 run_pending = 1;
2501 } 2505 }
2502 2506
2503 switch(dev->type) { 2507 switch (dev->type) {
2504#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) 2508#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
2505 case ARPHRD_SIT: 2509 case ARPHRD_SIT:
2506 addrconf_sit_config(dev); 2510 addrconf_sit_config(dev);
@@ -2837,7 +2841,7 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)
2837 * Optimistic nodes can start receiving 2841 * Optimistic nodes can start receiving
2838 * Frames right away 2842 * Frames right away
2839 */ 2843 */
2840 if(ifp->flags & IFA_F_OPTIMISTIC) 2844 if (ifp->flags & IFA_F_OPTIMISTIC)
2841 ip6_ins_rt(ifp->rt); 2845 ip6_ins_rt(ifp->rt);
2842 2846
2843 addrconf_dad_kick(ifp); 2847 addrconf_dad_kick(ifp);
@@ -2887,7 +2891,7 @@ out:
2887 2891
2888static void addrconf_dad_completed(struct inet6_ifaddr *ifp) 2892static void addrconf_dad_completed(struct inet6_ifaddr *ifp)
2889{ 2893{
2890 struct net_device * dev = ifp->idev->dev; 2894 struct net_device *dev = ifp->idev->dev;
2891 2895
2892 /* 2896 /*
2893 * Configure the address for reception. Now it is valid. 2897 * Configure the address for reception. Now it is valid.
@@ -2918,7 +2922,8 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp)
2918 } 2922 }
2919} 2923}
2920 2924
2921static void addrconf_dad_run(struct inet6_dev *idev) { 2925static void addrconf_dad_run(struct inet6_dev *idev)
2926{
2922 struct inet6_ifaddr *ifp; 2927 struct inet6_ifaddr *ifp;
2923 2928
2924 read_lock_bh(&idev->lock); 2929 read_lock_bh(&idev->lock);
@@ -2983,7 +2988,7 @@ static struct inet6_ifaddr *if6_get_idx(struct seq_file *seq, loff_t pos)
2983 struct inet6_ifaddr *ifa = if6_get_first(seq); 2988 struct inet6_ifaddr *ifa = if6_get_first(seq);
2984 2989
2985 if (ifa) 2990 if (ifa)
2986 while(pos && (ifa = if6_get_next(seq, ifa)) != NULL) 2991 while (pos && (ifa = if6_get_next(seq, ifa)) != NULL)
2987 --pos; 2992 --pos;
2988 return pos ? NULL : ifa; 2993 return pos ? NULL : ifa;
2989} 2994}
@@ -3492,8 +3497,7 @@ static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca,
3492 return nlmsg_end(skb, nlh); 3497 return nlmsg_end(skb, nlh);
3493} 3498}
3494 3499
3495enum addr_type_t 3500enum addr_type_t {
3496{
3497 UNICAST_ADDR, 3501 UNICAST_ADDR,
3498 MULTICAST_ADDR, 3502 MULTICAST_ADDR,
3499 ANYCAST_ADDR, 3503 ANYCAST_ADDR,
@@ -3592,7 +3596,8 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
3592 if (idx > s_idx) 3596 if (idx > s_idx)
3593 s_ip_idx = 0; 3597 s_ip_idx = 0;
3594 ip_idx = 0; 3598 ip_idx = 0;
3595 if ((idev = __in6_dev_get(dev)) == NULL) 3599 idev = __in6_dev_get(dev);
3600 if (!idev)
3596 goto cont; 3601 goto cont;
3597 3602
3598 if (in6_dump_addrs(idev, skb, cb, type, 3603 if (in6_dump_addrs(idev, skb, cb, type,
@@ -3659,12 +3664,14 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh,
3659 if (ifm->ifa_index) 3664 if (ifm->ifa_index)
3660 dev = __dev_get_by_index(net, ifm->ifa_index); 3665 dev = __dev_get_by_index(net, ifm->ifa_index);
3661 3666
3662 if ((ifa = ipv6_get_ifaddr(net, addr, dev, 1)) == NULL) { 3667 ifa = ipv6_get_ifaddr(net, addr, dev, 1);
3668 if (!ifa) {
3663 err = -EADDRNOTAVAIL; 3669 err = -EADDRNOTAVAIL;
3664 goto errout; 3670 goto errout;
3665 } 3671 }
3666 3672
3667 if ((skb = nlmsg_new(inet6_ifaddr_msgsize(), GFP_KERNEL)) == NULL) { 3673 skb = nlmsg_new(inet6_ifaddr_msgsize(), GFP_KERNEL);
3674 if (!skb) {
3668 err = -ENOBUFS; 3675 err = -ENOBUFS;
3669 goto errout_ifa; 3676 goto errout_ifa;
3670 } 3677 }
@@ -3789,7 +3796,7 @@ static inline void __snmp6_fill_stats(u64 *stats, void __percpu **mib,
3789static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype, 3796static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype,
3790 int bytes) 3797 int bytes)
3791{ 3798{
3792 switch(attrtype) { 3799 switch (attrtype) {
3793 case IFLA_INET6_STATS: 3800 case IFLA_INET6_STATS:
3794 __snmp6_fill_stats(stats, (void __percpu **)idev->stats.ipv6, IPSTATS_MIB_MAX, bytes); 3801 __snmp6_fill_stats(stats, (void __percpu **)idev->stats.ipv6, IPSTATS_MIB_MAX, bytes);
3795 break; 3802 break;
@@ -4141,211 +4148,211 @@ static struct addrconf_sysctl_table
4141 .sysctl_header = NULL, 4148 .sysctl_header = NULL,
4142 .addrconf_vars = { 4149 .addrconf_vars = {
4143 { 4150 {
4144 .procname = "forwarding", 4151 .procname = "forwarding",
4145 .data = &ipv6_devconf.forwarding, 4152 .data = &ipv6_devconf.forwarding,
4146 .maxlen = sizeof(int), 4153 .maxlen = sizeof(int),
4147 .mode = 0644, 4154 .mode = 0644,
4148 .proc_handler = addrconf_sysctl_forward, 4155 .proc_handler = addrconf_sysctl_forward,
4149 }, 4156 },
4150 { 4157 {
4151 .procname = "hop_limit", 4158 .procname = "hop_limit",
4152 .data = &ipv6_devconf.hop_limit, 4159 .data = &ipv6_devconf.hop_limit,
4153 .maxlen = sizeof(int), 4160 .maxlen = sizeof(int),
4154 .mode = 0644, 4161 .mode = 0644,
4155 .proc_handler = proc_dointvec, 4162 .proc_handler = proc_dointvec,
4156 }, 4163 },
4157 { 4164 {
4158 .procname = "mtu", 4165 .procname = "mtu",
4159 .data = &ipv6_devconf.mtu6, 4166 .data = &ipv6_devconf.mtu6,
4160 .maxlen = sizeof(int), 4167 .maxlen = sizeof(int),
4161 .mode = 0644, 4168 .mode = 0644,
4162 .proc_handler = proc_dointvec, 4169 .proc_handler = proc_dointvec,
4163 }, 4170 },
4164 { 4171 {
4165 .procname = "accept_ra", 4172 .procname = "accept_ra",
4166 .data = &ipv6_devconf.accept_ra, 4173 .data = &ipv6_devconf.accept_ra,
4167 .maxlen = sizeof(int), 4174 .maxlen = sizeof(int),
4168 .mode = 0644, 4175 .mode = 0644,
4169 .proc_handler = proc_dointvec, 4176 .proc_handler = proc_dointvec,
4170 }, 4177 },
4171 { 4178 {
4172 .procname = "accept_redirects", 4179 .procname = "accept_redirects",
4173 .data = &ipv6_devconf.accept_redirects, 4180 .data = &ipv6_devconf.accept_redirects,
4174 .maxlen = sizeof(int), 4181 .maxlen = sizeof(int),
4175 .mode = 0644, 4182 .mode = 0644,
4176 .proc_handler = proc_dointvec, 4183 .proc_handler = proc_dointvec,
4177 }, 4184 },
4178 { 4185 {
4179 .procname = "autoconf", 4186 .procname = "autoconf",
4180 .data = &ipv6_devconf.autoconf, 4187 .data = &ipv6_devconf.autoconf,
4181 .maxlen = sizeof(int), 4188 .maxlen = sizeof(int),
4182 .mode = 0644, 4189 .mode = 0644,
4183 .proc_handler = proc_dointvec, 4190 .proc_handler = proc_dointvec,
4184 }, 4191 },
4185 { 4192 {
4186 .procname = "dad_transmits", 4193 .procname = "dad_transmits",
4187 .data = &ipv6_devconf.dad_transmits, 4194 .data = &ipv6_devconf.dad_transmits,
4188 .maxlen = sizeof(int), 4195 .maxlen = sizeof(int),
4189 .mode = 0644, 4196 .mode = 0644,
4190 .proc_handler = proc_dointvec, 4197 .proc_handler = proc_dointvec,
4191 }, 4198 },
4192 { 4199 {
4193 .procname = "router_solicitations", 4200 .procname = "router_solicitations",
4194 .data = &ipv6_devconf.rtr_solicits, 4201 .data = &ipv6_devconf.rtr_solicits,
4195 .maxlen = sizeof(int), 4202 .maxlen = sizeof(int),
4196 .mode = 0644, 4203 .mode = 0644,
4197 .proc_handler = proc_dointvec, 4204 .proc_handler = proc_dointvec,
4198 }, 4205 },
4199 { 4206 {
4200 .procname = "router_solicitation_interval", 4207 .procname = "router_solicitation_interval",
4201 .data = &ipv6_devconf.rtr_solicit_interval, 4208 .data = &ipv6_devconf.rtr_solicit_interval,
4202 .maxlen = sizeof(int), 4209 .maxlen = sizeof(int),
4203 .mode = 0644, 4210 .mode = 0644,
4204 .proc_handler = proc_dointvec_jiffies, 4211 .proc_handler = proc_dointvec_jiffies,
4205 }, 4212 },
4206 { 4213 {
4207 .procname = "router_solicitation_delay", 4214 .procname = "router_solicitation_delay",
4208 .data = &ipv6_devconf.rtr_solicit_delay, 4215 .data = &ipv6_devconf.rtr_solicit_delay,
4209 .maxlen = sizeof(int), 4216 .maxlen = sizeof(int),
4210 .mode = 0644, 4217 .mode = 0644,
4211 .proc_handler = proc_dointvec_jiffies, 4218 .proc_handler = proc_dointvec_jiffies,
4212 }, 4219 },
4213 { 4220 {
4214 .procname = "force_mld_version", 4221 .procname = "force_mld_version",
4215 .data = &ipv6_devconf.force_mld_version, 4222 .data = &ipv6_devconf.force_mld_version,
4216 .maxlen = sizeof(int), 4223 .maxlen = sizeof(int),
4217 .mode = 0644, 4224 .mode = 0644,
4218 .proc_handler = proc_dointvec, 4225 .proc_handler = proc_dointvec,
4219 }, 4226 },
4220#ifdef CONFIG_IPV6_PRIVACY 4227#ifdef CONFIG_IPV6_PRIVACY
4221 { 4228 {
4222 .procname = "use_tempaddr", 4229 .procname = "use_tempaddr",
4223 .data = &ipv6_devconf.use_tempaddr, 4230 .data = &ipv6_devconf.use_tempaddr,
4224 .maxlen = sizeof(int), 4231 .maxlen = sizeof(int),
4225 .mode = 0644, 4232 .mode = 0644,
4226 .proc_handler = proc_dointvec, 4233 .proc_handler = proc_dointvec,
4227 }, 4234 },
4228 { 4235 {
4229 .procname = "temp_valid_lft", 4236 .procname = "temp_valid_lft",
4230 .data = &ipv6_devconf.temp_valid_lft, 4237 .data = &ipv6_devconf.temp_valid_lft,
4231 .maxlen = sizeof(int), 4238 .maxlen = sizeof(int),
4232 .mode = 0644, 4239 .mode = 0644,
4233 .proc_handler = proc_dointvec, 4240 .proc_handler = proc_dointvec,
4234 }, 4241 },
4235 { 4242 {
4236 .procname = "temp_prefered_lft", 4243 .procname = "temp_prefered_lft",
4237 .data = &ipv6_devconf.temp_prefered_lft, 4244 .data = &ipv6_devconf.temp_prefered_lft,
4238 .maxlen = sizeof(int), 4245 .maxlen = sizeof(int),
4239 .mode = 0644, 4246 .mode = 0644,
4240 .proc_handler = proc_dointvec, 4247 .proc_handler = proc_dointvec,
4241 }, 4248 },
4242 { 4249 {
4243 .procname = "regen_max_retry", 4250 .procname = "regen_max_retry",
4244 .data = &ipv6_devconf.regen_max_retry, 4251 .data = &ipv6_devconf.regen_max_retry,
4245 .maxlen = sizeof(int), 4252 .maxlen = sizeof(int),
4246 .mode = 0644, 4253 .mode = 0644,
4247 .proc_handler = proc_dointvec, 4254 .proc_handler = proc_dointvec,
4248 }, 4255 },
4249 { 4256 {
4250 .procname = "max_desync_factor", 4257 .procname = "max_desync_factor",
4251 .data = &ipv6_devconf.max_desync_factor, 4258 .data = &ipv6_devconf.max_desync_factor,
4252 .maxlen = sizeof(int), 4259 .maxlen = sizeof(int),
4253 .mode = 0644, 4260 .mode = 0644,
4254 .proc_handler = proc_dointvec, 4261 .proc_handler = proc_dointvec,
4255 }, 4262 },
4256#endif 4263#endif
4257 { 4264 {
4258 .procname = "max_addresses", 4265 .procname = "max_addresses",
4259 .data = &ipv6_devconf.max_addresses, 4266 .data = &ipv6_devconf.max_addresses,
4260 .maxlen = sizeof(int), 4267 .maxlen = sizeof(int),
4261 .mode = 0644, 4268 .mode = 0644,
4262 .proc_handler = proc_dointvec, 4269 .proc_handler = proc_dointvec,
4263 }, 4270 },
4264 { 4271 {
4265 .procname = "accept_ra_defrtr", 4272 .procname = "accept_ra_defrtr",
4266 .data = &ipv6_devconf.accept_ra_defrtr, 4273 .data = &ipv6_devconf.accept_ra_defrtr,
4267 .maxlen = sizeof(int), 4274 .maxlen = sizeof(int),
4268 .mode = 0644, 4275 .mode = 0644,
4269 .proc_handler = proc_dointvec, 4276 .proc_handler = proc_dointvec,
4270 }, 4277 },
4271 { 4278 {
4272 .procname = "accept_ra_pinfo", 4279 .procname = "accept_ra_pinfo",
4273 .data = &ipv6_devconf.accept_ra_pinfo, 4280 .data = &ipv6_devconf.accept_ra_pinfo,
4274 .maxlen = sizeof(int), 4281 .maxlen = sizeof(int),
4275 .mode = 0644, 4282 .mode = 0644,
4276 .proc_handler = proc_dointvec, 4283 .proc_handler = proc_dointvec,
4277 }, 4284 },
4278#ifdef CONFIG_IPV6_ROUTER_PREF 4285#ifdef CONFIG_IPV6_ROUTER_PREF
4279 { 4286 {
4280 .procname = "accept_ra_rtr_pref", 4287 .procname = "accept_ra_rtr_pref",
4281 .data = &ipv6_devconf.accept_ra_rtr_pref, 4288 .data = &ipv6_devconf.accept_ra_rtr_pref,
4282 .maxlen = sizeof(int), 4289 .maxlen = sizeof(int),
4283 .mode = 0644, 4290 .mode = 0644,
4284 .proc_handler = proc_dointvec, 4291 .proc_handler = proc_dointvec,
4285 }, 4292 },
4286 { 4293 {
4287 .procname = "router_probe_interval", 4294 .procname = "router_probe_interval",
4288 .data = &ipv6_devconf.rtr_probe_interval, 4295 .data = &ipv6_devconf.rtr_probe_interval,
4289 .maxlen = sizeof(int), 4296 .maxlen = sizeof(int),
4290 .mode = 0644, 4297 .mode = 0644,
4291 .proc_handler = proc_dointvec_jiffies, 4298 .proc_handler = proc_dointvec_jiffies,
4292 }, 4299 },
4293#ifdef CONFIG_IPV6_ROUTE_INFO 4300#ifdef CONFIG_IPV6_ROUTE_INFO
4294 { 4301 {
4295 .procname = "accept_ra_rt_info_max_plen", 4302 .procname = "accept_ra_rt_info_max_plen",
4296 .data = &ipv6_devconf.accept_ra_rt_info_max_plen, 4303 .data = &ipv6_devconf.accept_ra_rt_info_max_plen,
4297 .maxlen = sizeof(int), 4304 .maxlen = sizeof(int),
4298 .mode = 0644, 4305 .mode = 0644,
4299 .proc_handler = proc_dointvec, 4306 .proc_handler = proc_dointvec,
4300 }, 4307 },
4301#endif 4308#endif
4302#endif 4309#endif
4303 { 4310 {
4304 .procname = "proxy_ndp", 4311 .procname = "proxy_ndp",
4305 .data = &ipv6_devconf.proxy_ndp, 4312 .data = &ipv6_devconf.proxy_ndp,
4306 .maxlen = sizeof(int), 4313 .maxlen = sizeof(int),
4307 .mode = 0644, 4314 .mode = 0644,
4308 .proc_handler = proc_dointvec, 4315 .proc_handler = proc_dointvec,
4309 }, 4316 },
4310 { 4317 {
4311 .procname = "accept_source_route", 4318 .procname = "accept_source_route",
4312 .data = &ipv6_devconf.accept_source_route, 4319 .data = &ipv6_devconf.accept_source_route,
4313 .maxlen = sizeof(int), 4320 .maxlen = sizeof(int),
4314 .mode = 0644, 4321 .mode = 0644,
4315 .proc_handler = proc_dointvec, 4322 .proc_handler = proc_dointvec,
4316 }, 4323 },
4317#ifdef CONFIG_IPV6_OPTIMISTIC_DAD 4324#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
4318 { 4325 {
4319 .procname = "optimistic_dad", 4326 .procname = "optimistic_dad",
4320 .data = &ipv6_devconf.optimistic_dad, 4327 .data = &ipv6_devconf.optimistic_dad,
4321 .maxlen = sizeof(int), 4328 .maxlen = sizeof(int),
4322 .mode = 0644, 4329 .mode = 0644,
4323 .proc_handler = proc_dointvec, 4330 .proc_handler = proc_dointvec,
4324 4331
4325 }, 4332 },
4326#endif 4333#endif
4327#ifdef CONFIG_IPV6_MROUTE 4334#ifdef CONFIG_IPV6_MROUTE
4328 { 4335 {
4329 .procname = "mc_forwarding", 4336 .procname = "mc_forwarding",
4330 .data = &ipv6_devconf.mc_forwarding, 4337 .data = &ipv6_devconf.mc_forwarding,
4331 .maxlen = sizeof(int), 4338 .maxlen = sizeof(int),
4332 .mode = 0444, 4339 .mode = 0444,
4333 .proc_handler = proc_dointvec, 4340 .proc_handler = proc_dointvec,
4334 }, 4341 },
4335#endif 4342#endif
4336 { 4343 {
4337 .procname = "disable_ipv6", 4344 .procname = "disable_ipv6",
4338 .data = &ipv6_devconf.disable_ipv6, 4345 .data = &ipv6_devconf.disable_ipv6,
4339 .maxlen = sizeof(int), 4346 .maxlen = sizeof(int),
4340 .mode = 0644, 4347 .mode = 0644,
4341 .proc_handler = addrconf_sysctl_disable, 4348 .proc_handler = addrconf_sysctl_disable,
4342 }, 4349 },
4343 { 4350 {
4344 .procname = "accept_dad", 4351 .procname = "accept_dad",
4345 .data = &ipv6_devconf.accept_dad, 4352 .data = &ipv6_devconf.accept_dad,
4346 .maxlen = sizeof(int), 4353 .maxlen = sizeof(int),
4347 .mode = 0644, 4354 .mode = 0644,
4348 .proc_handler = proc_dointvec, 4355 .proc_handler = proc_dointvec,
4349 }, 4356 },
4350 { 4357 {
4351 .procname = "force_tllao", 4358 .procname = "force_tllao",
@@ -4382,7 +4389,7 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
4382 goto out; 4389 goto out;
4383 4390
4384 for (i = 0; t->addrconf_vars[i].data; i++) { 4391 for (i = 0; t->addrconf_vars[i].data; i++) {
4385 t->addrconf_vars[i].data += (char*)p - (char*)&ipv6_devconf; 4392 t->addrconf_vars[i].data += (char *)p - (char *)&ipv6_devconf;
4386 t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */ 4393 t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */
4387 t->addrconf_vars[i].extra2 = net; 4394 t->addrconf_vars[i].extra2 = net;
4388 } 4395 }
@@ -4519,14 +4526,12 @@ int register_inet6addr_notifier(struct notifier_block *nb)
4519{ 4526{
4520 return atomic_notifier_chain_register(&inet6addr_chain, nb); 4527 return atomic_notifier_chain_register(&inet6addr_chain, nb);
4521} 4528}
4522
4523EXPORT_SYMBOL(register_inet6addr_notifier); 4529EXPORT_SYMBOL(register_inet6addr_notifier);
4524 4530
4525int unregister_inet6addr_notifier(struct notifier_block *nb) 4531int unregister_inet6addr_notifier(struct notifier_block *nb)
4526{ 4532{
4527 return atomic_notifier_chain_unregister(&inet6addr_chain,nb); 4533 return atomic_notifier_chain_unregister(&inet6addr_chain, nb);
4528} 4534}
4529
4530EXPORT_SYMBOL(unregister_inet6addr_notifier); 4535EXPORT_SYMBOL(unregister_inet6addr_notifier);
4531 4536
4532/* 4537/*
@@ -4537,9 +4542,10 @@ int __init addrconf_init(void)
4537{ 4542{
4538 int i, err; 4543 int i, err;
4539 4544
4540 if ((err = ipv6_addr_label_init()) < 0) { 4545 err = ipv6_addr_label_init();
4541 printk(KERN_CRIT "IPv6 Addrconf: cannot initialize default policy table: %d.\n", 4546 if (err < 0) {
4542 err); 4547 printk(KERN_CRIT "IPv6 Addrconf:"
4548 " cannot initialize default policy table: %d.\n", err);
4543 return err; 4549 return err;
4544 } 4550 }
4545 4551