aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
commitdf39e8ba56a788733d369068c7319e04b1da3cd5 (patch)
tree1e9be853bdb455e341cdbf957656f342cfa2eb9e /net/ipv6
parentf5572855ec492334d8c3ec0e0e86c31865d5cf07 (diff)
parent159d83363b629c91d020734207c1bc788b96af5a (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/ehea/ehea_main.c drivers/net/wireless/iwlwifi/Kconfig drivers/net/wireless/rt2x00/rt61pci.c net/ipv4/inet_timewait_sock.c net/ipv6/raw.c net/mac80211/ieee80211_sta.c
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c31
-rw-r--r--net/ipv6/anycast.c9
-rw-r--r--net/ipv6/icmp.c22
3 files changed, 30 insertions, 32 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9d49ed2578d7..8a0fd4007bdb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -372,25 +372,26 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
372 */ 372 */
373 in6_dev_hold(ndev); 373 in6_dev_hold(ndev);
374 374
375#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
376 if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
377 printk(KERN_INFO
378 "%s: Disabled Multicast RS\n",
379 dev->name);
380 ndev->cnf.rtr_solicits = 0;
381 }
382#endif
383
375#ifdef CONFIG_IPV6_PRIVACY 384#ifdef CONFIG_IPV6_PRIVACY
376 setup_timer(&ndev->regen_timer, ipv6_regen_rndid, (unsigned long)ndev); 385 setup_timer(&ndev->regen_timer, ipv6_regen_rndid, (unsigned long)ndev);
377 if ((dev->flags&IFF_LOOPBACK) || 386 if ((dev->flags&IFF_LOOPBACK) ||
378 dev->type == ARPHRD_TUNNEL || 387 dev->type == ARPHRD_TUNNEL ||
379#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) 388 dev->type == ARPHRD_TUNNEL6 ||
380 dev->type == ARPHRD_SIT || 389 dev->type == ARPHRD_SIT ||
381#endif
382 dev->type == ARPHRD_NONE) { 390 dev->type == ARPHRD_NONE) {
383 printk(KERN_INFO 391 printk(KERN_INFO
384 "%s: Disabled Privacy Extensions\n", 392 "%s: Disabled Privacy Extensions\n",
385 dev->name); 393 dev->name);
386 ndev->cnf.use_tempaddr = -1; 394 ndev->cnf.use_tempaddr = -1;
387
388 if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
389 printk(KERN_INFO
390 "%s: Disabled Multicast RS\n",
391 dev->name);
392 ndev->cnf.rtr_solicits = 0;
393 }
394 } else { 395 } else {
395 in6_dev_hold(ndev); 396 in6_dev_hold(ndev);
396 ipv6_regen_rndid((unsigned long) ndev); 397 ipv6_regen_rndid((unsigned long) ndev);
@@ -2529,7 +2530,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2529 2530
2530 ASSERT_RTNL(); 2531 ASSERT_RTNL();
2531 2532
2532 if (dev == init_net.loopback_dev && how == 1) 2533 if ((dev->flags & IFF_LOOPBACK) && how == 1)
2533 how = 0; 2534 how = 0;
2534 2535
2535 rt6_ifdown(net, dev); 2536 rt6_ifdown(net, dev);
@@ -2542,7 +2543,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2542 /* Step 1: remove reference to ipv6 device from parent device. 2543 /* Step 1: remove reference to ipv6 device from parent device.
2543 Do not dev_put! 2544 Do not dev_put!
2544 */ 2545 */
2545 if (how == 1) { 2546 if (how) {
2546 idev->dead = 1; 2547 idev->dead = 1;
2547 2548
2548 /* protected by rtnl_lock */ 2549 /* protected by rtnl_lock */
@@ -2574,12 +2575,12 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2574 write_lock_bh(&idev->lock); 2575 write_lock_bh(&idev->lock);
2575 2576
2576 /* Step 3: clear flags for stateless addrconf */ 2577 /* Step 3: clear flags for stateless addrconf */
2577 if (how != 1) 2578 if (!how)
2578 idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); 2579 idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY);
2579 2580
2580 /* Step 4: clear address list */ 2581 /* Step 4: clear address list */
2581#ifdef CONFIG_IPV6_PRIVACY 2582#ifdef CONFIG_IPV6_PRIVACY
2582 if (how == 1 && del_timer(&idev->regen_timer)) 2583 if (how && del_timer(&idev->regen_timer))
2583 in6_dev_put(idev); 2584 in6_dev_put(idev);
2584 2585
2585 /* clear tempaddr list */ 2586 /* clear tempaddr list */
@@ -2616,7 +2617,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2616 2617
2617 /* Step 5: Discard multicast list */ 2618 /* Step 5: Discard multicast list */
2618 2619
2619 if (how == 1) 2620 if (how)
2620 ipv6_mc_destroy_dev(idev); 2621 ipv6_mc_destroy_dev(idev);
2621 else 2622 else
2622 ipv6_mc_down(idev); 2623 ipv6_mc_down(idev);
@@ -2625,7 +2626,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
2625 2626
2626 /* Shot the device (if unregistered) */ 2627 /* Shot the device (if unregistered) */
2627 2628
2628 if (how == 1) { 2629 if (how) {
2629 addrconf_sysctl_unregister(idev); 2630 addrconf_sysctl_unregister(idev);
2630 neigh_parms_release(&nd_tbl, idev->nd_parms); 2631 neigh_parms_release(&nd_tbl, idev->nd_parms);
2631 neigh_ifdown(&nd_tbl, dev); 2632 neigh_ifdown(&nd_tbl, dev);
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 36e817492095..4e1b29fabdf0 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -314,9 +314,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr)
314 idev->ac_list = aca; 314 idev->ac_list = aca;
315 write_unlock_bh(&idev->lock); 315 write_unlock_bh(&idev->lock);
316 316
317 dst_hold(&rt->u.dst); 317 ip6_ins_rt(rt);
318 if (ip6_ins_rt(rt))
319 dst_release(&rt->u.dst);
320 318
321 addrconf_join_solict(dev, &aca->aca_addr); 319 addrconf_join_solict(dev, &aca->aca_addr);
322 320
@@ -358,10 +356,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr)
358 addrconf_leave_solict(idev, &aca->aca_addr); 356 addrconf_leave_solict(idev, &aca->aca_addr);
359 357
360 dst_hold(&aca->aca_rt->u.dst); 358 dst_hold(&aca->aca_rt->u.dst);
361 if (ip6_del_rt(aca->aca_rt)) 359 ip6_del_rt(aca->aca_rt);
362 dst_free(&aca->aca_rt->u.dst);
363 else
364 dst_release(&aca->aca_rt->u.dst);
365 360
366 aca_put(aca); 361 aca_put(aca);
367 return 0; 362 return 0;
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 195086114e63..d42dd16d3487 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -441,24 +441,26 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
441 } 441 }
442 442
443 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) 443 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6))
444 goto out_dst_release; 444 goto relookup_failed;
445 445
446 if (ip6_dst_lookup(sk, &dst2, &fl)) 446 if (ip6_dst_lookup(sk, &dst2, &fl))
447 goto out_dst_release; 447 goto relookup_failed;
448 448
449 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); 449 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP);
450 if (err == -ENOENT) { 450 switch (err) {
451 case 0:
452 dst_release(dst);
453 dst = dst2;
454 break;
455 case -EPERM:
456 goto out_dst_release;
457 default:
458relookup_failed:
451 if (!dst) 459 if (!dst)
452 goto out; 460 goto out;
453 goto route_done; 461 break;
454 } 462 }
455 463
456 dst_release(dst);
457 dst = dst2;
458
459 if (err)
460 goto out;
461
462route_done: 464route_done:
463 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 465 if (ipv6_addr_is_multicast(&fl.fl6_dst))
464 hlimit = np->mcast_hops; 466 hlimit = np->mcast_hops;