#define IN6_ADDR_HSIZE_SHIFT   8
 #define IN6_ADDR_HSIZE         (1 << IN6_ADDR_HSIZE_SHIFT)
-/*
- *     Configured unicast address hash table
- */
-static struct hlist_head inet6_addr_lst[IN6_ADDR_HSIZE];
-static DEFINE_SPINLOCK(addrconf_hash_lock);
 
 static void addrconf_verify(struct net *net);
 static void addrconf_verify_rtnl(struct net *net);
 {
        struct inet6_ifaddr *ifp;
 
-       hlist_for_each_entry(ifp, &inet6_addr_lst[hash], addr_lst) {
-               if (!net_eq(dev_net(ifp->idev->dev), net))
-                       continue;
+       hlist_for_each_entry(ifp, &net->ipv6.inet6_addr_lst[hash], addr_lst) {
                if (ipv6_addr_equal(&ifp->addr, addr)) {
                        if (!dev || ifp->idev->dev == dev)
                                return true;
 
 static int ipv6_add_addr_hash(struct net_device *dev, struct inet6_ifaddr *ifa)
 {
-       unsigned int hash = inet6_addr_hash(dev_net(dev), &ifa->addr);
+       struct net *net = dev_net(dev);
+       unsigned int hash = inet6_addr_hash(net, &ifa->addr);
        int err = 0;
 
-       spin_lock(&addrconf_hash_lock);
+       spin_lock(&net->ipv6.addrconf_hash_lock);
 
        /* Ignore adding duplicate addresses on an interface */
-       if (ipv6_chk_same_addr(dev_net(dev), &ifa->addr, dev, hash)) {
+       if (ipv6_chk_same_addr(net, &ifa->addr, dev, hash)) {
                netdev_dbg(dev, "ipv6_add_addr: already assigned\n");
                err = -EEXIST;
        } else {
-               hlist_add_head_rcu(&ifa->addr_lst, &inet6_addr_lst[hash]);
+               hlist_add_head_rcu(&ifa->addr_lst, &net->ipv6.inet6_addr_lst[hash]);
        }
 
-       spin_unlock(&addrconf_hash_lock);
+       spin_unlock(&net->ipv6.addrconf_hash_lock);
 
        return err;
 }
 
 static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 {
-       int state;
        enum cleanup_prefix_rt_t action = CLEANUP_PREFIX_RT_NOP;
+       struct net *net = dev_net(ifp->idev->dev);
        unsigned long expires;
+       int state;
 
        ASSERT_RTNL();
 
        if (state == INET6_IFADDR_STATE_DEAD)
                goto out;
 
-       spin_lock_bh(&addrconf_hash_lock);
+       spin_lock_bh(&net->ipv6.addrconf_hash_lock);
        hlist_del_init_rcu(&ifp->addr_lst);
-       spin_unlock_bh(&addrconf_hash_lock);
+       spin_unlock_bh(&net->ipv6.addrconf_hash_lock);
 
        write_lock_bh(&ifp->idev->lock);
 
        if (skip_dev_check)
                dev = NULL;
 
-       hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) {
+       hlist_for_each_entry_rcu(ifp, &net->ipv6.inet6_addr_lst[hash], addr_lst) {
                ndev = ifp->idev->dev;
-               if (!net_eq(dev_net(ndev), net))
-                       continue;
 
                if (l3mdev_master_dev_rcu(ndev) != l3mdev)
                        continue;
        struct inet6_ifaddr *ifp, *result = NULL;
 
        rcu_read_lock();
-       hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) {
-               if (!net_eq(dev_net(ifp->idev->dev), net))
-                       continue;
+       hlist_for_each_entry_rcu(ifp, &net->ipv6.inet6_addr_lst[hash], addr_lst) {
                if (ipv6_addr_equal(&ifp->addr, addr)) {
                        if (!dev || ifp->idev->dev == dev ||
                            !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) {
 void addrconf_dad_failure(struct sk_buff *skb, struct inet6_ifaddr *ifp)
 {
        struct inet6_dev *idev = ifp->idev;
-       struct net *net = dev_net(ifp->idev->dev);
+       struct net *net = dev_net(idev->dev);
 
        if (addrconf_dad_end(ifp)) {
                in6_ifa_put(ifp);
 
        /* Step 2: clear hash table */
        for (i = 0; i < IN6_ADDR_HSIZE; i++) {
-               struct hlist_head *h = &inet6_addr_lst[i];
+               struct hlist_head *h = &net->ipv6.inet6_addr_lst[i];
 
-               spin_lock_bh(&addrconf_hash_lock);
+               spin_lock_bh(&net->ipv6.addrconf_hash_lock);
 restart:
                hlist_for_each_entry_rcu(ifa, h, addr_lst) {
                        if (ifa->idev == idev) {
                                }
                        }
                }
-               spin_unlock_bh(&addrconf_hash_lock);
+               spin_unlock_bh(&net->ipv6.addrconf_hash_lock);
        }
 
        write_lock_bh(&idev->lock);
        }
 
        for (; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) {
-               hlist_for_each_entry_rcu(ifa, &inet6_addr_lst[state->bucket],
+               hlist_for_each_entry_rcu(ifa, &net->ipv6.inet6_addr_lst[state->bucket],
                                         addr_lst) {
-                       if (!net_eq(dev_net(ifa->idev->dev), net))
-                               continue;
                        /* sync with offset */
                        if (p < state->offset) {
                                p++;
        struct net *net = seq_file_net(seq);
 
        hlist_for_each_entry_continue_rcu(ifa, addr_lst) {
-               if (!net_eq(dev_net(ifa->idev->dev), net))
-                       continue;
                state->offset++;
                return ifa;
        }
        state->offset = 0;
        while (++state->bucket < IN6_ADDR_HSIZE) {
                hlist_for_each_entry_rcu(ifa,
-                                    &inet6_addr_lst[state->bucket], addr_lst) {
-                       if (!net_eq(dev_net(ifa->idev->dev), net))
-                               continue;
+                                    &net->ipv6.inet6_addr_lst[state->bucket], addr_lst) {
                        return ifa;
                }
        }
        int ret = 0;
 
        rcu_read_lock();
-       hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) {
-               if (!net_eq(dev_net(ifp->idev->dev), net))
-                       continue;
+       hlist_for_each_entry_rcu(ifp, &net->ipv6.inet6_addr_lst[hash], addr_lst) {
                if (ipv6_addr_equal(&ifp->addr, addr) &&
                    (ifp->flags & IFA_F_HOMEADDRESS)) {
                        ret = 1;
                hash = inet6_addr_hash(net, addr);
 
                hash_found = false;
-               hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) {
-                       if (!net_eq(dev_net(ifp->idev->dev), net))
-                               continue;
+               hlist_for_each_entry_rcu(ifp, &net->ipv6.inet6_addr_lst[hash], addr_lst) {
 
                        if (ipv6_addr_equal(&ifp->addr, addr)) {
                                hash_found = true;
 
        for (i = 0; i < IN6_ADDR_HSIZE; i++) {
 restart:
-               hlist_for_each_entry_rcu_bh(ifp, &inet6_addr_lst[i], addr_lst) {
+               hlist_for_each_entry_rcu_bh(ifp, &net->ipv6.inet6_addr_lst[i], addr_lst) {
                        unsigned long age;
 
                        /* When setting preferred_lft to a value not zero or
 int __init addrconf_init(void)
 {
        struct inet6_dev *idev;
-       int i, err;
+       int err;
 
        err = ipv6_addr_label_init();
        if (err < 0) {
 
        ip6_route_init_special_entries();
 
-       for (i = 0; i < IN6_ADDR_HSIZE; i++)
-               INIT_HLIST_HEAD(&inet6_addr_lst[i]);
-
        register_netdevice_notifier(&ipv6_dev_notf);
 
        addrconf_verify(&init_net);
 void addrconf_cleanup(void)
 {
        struct net_device *dev;
-       int i;
 
        unregister_netdevice_notifier(&ipv6_dev_notf);
        unregister_pernet_subsys(&addrconf_ops);
        }
        addrconf_ifdown(init_net.loopback_dev, true);
 
-       /*
-        *      Check hash table.
-        */
-       spin_lock_bh(&addrconf_hash_lock);
-       for (i = 0; i < IN6_ADDR_HSIZE; i++)
-               WARN_ON(!hlist_empty(&inet6_addr_lst[i]));
-       spin_unlock_bh(&addrconf_hash_lock);
-
        rtnl_unlock();
 
        destroy_workqueue(addrconf_wq);