addrconf.c (4c5ff6a6fe794f102479db998c69054319279e3c) | addrconf.c (f2344a131bccdbfc5338e17fa71a807dee7944fa) |
---|---|
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 * --- 1392 unchanged lines hidden (view full) --- 1401 spin_unlock_bh(&ifp->lock); 1402 } 1403 ipv6_del_addr(ifp); 1404#endif 1405 } else 1406 ipv6_del_addr(ifp); 1407} 1408 | 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 * --- 1392 unchanged lines hidden (view full) --- 1401 spin_unlock_bh(&ifp->lock); 1402 } 1403 ipv6_del_addr(ifp); 1404#endif 1405 } else 1406 ipv6_del_addr(ifp); 1407} 1408 |
1409static int addrconf_dad_end(struct inet6_ifaddr *ifp) 1410{ 1411 int err = -ENOENT; 1412 1413 spin_lock(&ifp->state_lock); 1414 if (ifp->state == INET6_IFADDR_STATE_DAD) { 1415 ifp->state = INET6_IFADDR_STATE_POSTDAD; 1416 err = 0; 1417 } 1418 spin_unlock(&ifp->state_lock); 1419 1420 return err; 1421} 1422 |
|
1409void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1410{ 1411 struct inet6_dev *idev = ifp->idev; 1412 | 1423void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1424{ 1425 struct inet6_dev *idev = ifp->idev; 1426 |
1427 if (addrconf_dad_end(ifp)) 1428 return; 1429 |
|
1413 if (net_ratelimit()) 1414 printk(KERN_INFO "%s: IPv6 duplicate address %pI6c detected!\n", 1415 ifp->idev->dev->name, &ifp->addr); 1416 1417 if (idev->cnf.accept_dad > 1 && !idev->cnf.disable_ipv6) { 1418 struct in6_addr addr; 1419 1420 addr.s6_addr32[0] = htonl(0xfe800000); --- 1286 unchanged lines hidden (view full) --- 2707 continue; 2708 2709 /* If it was tentative already, no need to notify */ 2710 if (ifa->flags & IFA_F_TENTATIVE) 2711 continue; 2712 2713 /* Flag it for later restoration when link comes up */ 2714 ifa->flags |= IFA_F_TENTATIVE; | 1430 if (net_ratelimit()) 1431 printk(KERN_INFO "%s: IPv6 duplicate address %pI6c detected!\n", 1432 ifp->idev->dev->name, &ifp->addr); 1433 1434 if (idev->cnf.accept_dad > 1 && !idev->cnf.disable_ipv6) { 1435 struct in6_addr addr; 1436 1437 addr.s6_addr32[0] = htonl(0xfe800000); --- 1286 unchanged lines hidden (view full) --- 2724 continue; 2725 2726 /* If it was tentative already, no need to notify */ 2727 if (ifa->flags & IFA_F_TENTATIVE) 2728 continue; 2729 2730 /* Flag it for later restoration when link comes up */ 2731 ifa->flags |= IFA_F_TENTATIVE; |
2732 ifa->state = INET6_IFADDR_STATE_DAD; |
|
2715 2716 write_unlock_bh(&idev->lock); 2717 2718 in6_ifa_hold(ifa); 2719 } else { 2720 list_del(&ifa->if_list); 2721 2722 /* clear hash table */ --- 155 unchanged lines hidden (view full) --- 2878} 2879 2880static void addrconf_dad_timer(unsigned long data) 2881{ 2882 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; 2883 struct inet6_dev *idev = ifp->idev; 2884 struct in6_addr mcaddr; 2885 | 2733 2734 write_unlock_bh(&idev->lock); 2735 2736 in6_ifa_hold(ifa); 2737 } else { 2738 list_del(&ifa->if_list); 2739 2740 /* clear hash table */ --- 155 unchanged lines hidden (view full) --- 2896} 2897 2898static void addrconf_dad_timer(unsigned long data) 2899{ 2900 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; 2901 struct inet6_dev *idev = ifp->idev; 2902 struct in6_addr mcaddr; 2903 |
2904 if (!ifp->probes && addrconf_dad_end(ifp)) 2905 goto out; 2906 |
|
2886 read_lock(&idev->lock); 2887 if (idev->dead || !(idev->if_flags & IF_READY)) { 2888 read_unlock(&idev->lock); 2889 goto out; 2890 } 2891 2892 spin_lock(&ifp->lock); 2893 if (ifp->probes == 0) { --- 57 unchanged lines hidden (view full) --- 2951 2952static void addrconf_dad_run(struct inet6_dev *idev) 2953{ 2954 struct inet6_ifaddr *ifp; 2955 2956 read_lock_bh(&idev->lock); 2957 list_for_each_entry(ifp, &idev->addr_list, if_list) { 2958 spin_lock(&ifp->lock); | 2907 read_lock(&idev->lock); 2908 if (idev->dead || !(idev->if_flags & IF_READY)) { 2909 read_unlock(&idev->lock); 2910 goto out; 2911 } 2912 2913 spin_lock(&ifp->lock); 2914 if (ifp->probes == 0) { --- 57 unchanged lines hidden (view full) --- 2972 2973static void addrconf_dad_run(struct inet6_dev *idev) 2974{ 2975 struct inet6_ifaddr *ifp; 2976 2977 read_lock_bh(&idev->lock); 2978 list_for_each_entry(ifp, &idev->addr_list, if_list) { 2979 spin_lock(&ifp->lock); |
2959 if (!(ifp->flags & IFA_F_TENTATIVE)) { 2960 spin_unlock(&ifp->lock); 2961 continue; 2962 } | 2980 if (ifp->flags & IFA_F_TENTATIVE && 2981 ifp->state == INET6_IFADDR_STATE_DAD) 2982 addrconf_dad_kick(ifp); |
2963 spin_unlock(&ifp->lock); | 2983 spin_unlock(&ifp->lock); |
2964 addrconf_dad_kick(ifp); | |
2965 } 2966 read_unlock_bh(&idev->lock); 2967} 2968 2969#ifdef CONFIG_PROC_FS 2970struct if6_iter_state { 2971 struct seq_net_private p; 2972 int bucket; --- 1703 unchanged lines hidden --- | 2984 } 2985 read_unlock_bh(&idev->lock); 2986} 2987 2988#ifdef CONFIG_PROC_FS 2989struct if6_iter_state { 2990 struct seq_net_private p; 2991 int bucket; --- 1703 unchanged lines hidden --- |