if (del_timer(&ifp->timer))
pr_notice("Timer is still running, when freeing ifa=%p\n", ifp);
- if (!ifp->dead) {
+ if (ifp->state != INET6_IFADDR_STATE_DEAD) {
pr_warning("Freeing alive inet6 address %p\n", ifp);
return;
}
ipv6_addr_copy(&ifa->addr, addr);
spin_lock_init(&ifa->lock);
+ spin_lock_init(&ifa->state_lock);
init_timer(&ifa->timer);
INIT_HLIST_NODE(&ifa->addr_lst);
ifa->timer.data = (unsigned long) ifa;
hash = ipv6_addr_hash(&ifp->addr);
- ifp->dead = 1;
+ ifp->state = INET6_IFADDR_STATE_DEAD;
spin_lock_bh(&addrconf_hash_lock);
hlist_del_init_rcu(&ifp->addr_lst);
ifa = list_first_entry(&idev->tempaddr_list,
struct inet6_ifaddr, tmp_list);
list_del(&ifa->tmp_list);
- ifa->dead = 1;
+ ifa->state = INET6_IFADDR_STATE_DEAD;
write_unlock_bh(&idev->lock);
spin_lock_bh(&ifa->lock);
write_unlock_bh(&idev->lock);
} else {
list_del(&ifa->if_list);
- ifa->dead = 1;
+ ifa->state = INET6_IFADDR_STATE_DEAD;
write_unlock_bh(&idev->lock);
/* clear hash table */
}
__ipv6_ifa_notify(RTM_DELADDR, ifa);
- if (ifa->dead)
+ if (ifa->state == INET6_IFADDR_STATE_DEAD)
atomic_notifier_call_chain(&inet6addr_chain,
NETDEV_DOWN, ifa);
in6_ifa_put(ifa);
net_srandom(ifp->addr.s6_addr32[3]);
read_lock_bh(&idev->lock);
- if (ifp->dead)
+ if (ifp->state == INET6_IFADDR_STATE_DEAD)
goto out;
spin_lock(&ifp->lock);
addrconf_leave_solict(ifp->idev, &ifp->addr);
dst_hold(&ifp->rt->u.dst);
- if (ifp->dead && ip6_del_rt(ifp->rt))
+ if (ifp->state == INET6_IFADDR_STATE_DEAD &&
+ ip6_del_rt(ifp->rt))
dst_free(&ifp->rt->u.dst);
break;
}