addrconf.c (3a37471551cd3b287ce7f02ed25bcf8ec37a191d) addrconf.c (a2d6cbb0670d54806f18192cb0db266b4a6d285a)
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 3612 unchanged lines hidden (view full) ---

3621 /* re-combine the user config with event to determine if permanent
3622 * addresses are to be removed from the interface list
3623 */
3624 keep_addr = (!how && _keep_addr > 0 && !idev->cnf.disable_ipv6);
3625
3626 INIT_LIST_HEAD(&del_list);
3627 list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
3628 struct rt6_info *rt = NULL;
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 3612 unchanged lines hidden (view full) ---

3621 /* re-combine the user config with event to determine if permanent
3622 * addresses are to be removed from the interface list
3623 */
3624 keep_addr = (!how && _keep_addr > 0 && !idev->cnf.disable_ipv6);
3625
3626 INIT_LIST_HEAD(&del_list);
3627 list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
3628 struct rt6_info *rt = NULL;
3629 bool keep;
3629
3630 addrconf_del_dad_work(ifa);
3631
3630
3631 addrconf_del_dad_work(ifa);
3632
3633 keep = keep_addr && (ifa->flags & IFA_F_PERMANENT) &&
3634 !addr_is_local(&ifa->addr);
3635 if (!keep)
3636 list_move(&ifa->if_list, &del_list);
3637
3632 write_unlock_bh(&idev->lock);
3633 spin_lock_bh(&ifa->lock);
3634
3638 write_unlock_bh(&idev->lock);
3639 spin_lock_bh(&ifa->lock);
3640
3635 if (keep_addr && (ifa->flags & IFA_F_PERMANENT) &&
3636 !addr_is_local(&ifa->addr)) {
3641 if (keep) {
3637 /* set state to skip the notifier below */
3638 state = INET6_IFADDR_STATE_DEAD;
3639 ifa->state = 0;
3640 if (!(ifa->flags & IFA_F_NODAD))
3641 ifa->flags |= IFA_F_TENTATIVE;
3642
3643 rt = ifa->rt;
3644 ifa->rt = NULL;
3645 } else {
3646 state = ifa->state;
3647 ifa->state = INET6_IFADDR_STATE_DEAD;
3642 /* set state to skip the notifier below */
3643 state = INET6_IFADDR_STATE_DEAD;
3644 ifa->state = 0;
3645 if (!(ifa->flags & IFA_F_NODAD))
3646 ifa->flags |= IFA_F_TENTATIVE;
3647
3648 rt = ifa->rt;
3649 ifa->rt = NULL;
3650 } else {
3651 state = ifa->state;
3652 ifa->state = INET6_IFADDR_STATE_DEAD;
3648
3649 list_move(&ifa->if_list, &del_list);
3650 }
3651
3652 spin_unlock_bh(&ifa->lock);
3653
3654 if (rt)
3655 ip6_del_rt(rt);
3656
3657 if (state != INET6_IFADDR_STATE_DEAD) {

--- 2815 unchanged lines hidden ---
3653 }
3654
3655 spin_unlock_bh(&ifa->lock);
3656
3657 if (rt)
3658 ip6_del_rt(rt);
3659
3660 if (state != INET6_IFADDR_STATE_DEAD) {

--- 2815 unchanged lines hidden ---