Loading net/ipv6/addrconf.c +3 −5 Original line number Original line Diff line number Diff line Loading @@ -1859,20 +1859,18 @@ static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr, bool ipv6_chk_custom_prefix(const struct in6_addr *addr, bool ipv6_chk_custom_prefix(const struct in6_addr *addr, const unsigned int prefix_len, struct net_device *dev) const unsigned int prefix_len, struct net_device *dev) { { struct inet6_dev *idev; const struct inet6_ifaddr *ifa; struct inet6_ifaddr *ifa; const struct inet6_dev *idev; bool ret = false; bool ret = false; rcu_read_lock(); rcu_read_lock(); idev = __in6_dev_get(dev); idev = __in6_dev_get(dev); if (idev) { if (idev) { read_lock_bh(&idev->lock); list_for_each_entry_rcu(ifa, &idev->addr_list, if_list) { list_for_each_entry(ifa, &idev->addr_list, if_list) { ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len); ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len); if (ret) if (ret) break; break; } } read_unlock_bh(&idev->lock); } } rcu_read_unlock(); rcu_read_unlock(); Loading Loading
net/ipv6/addrconf.c +3 −5 Original line number Original line Diff line number Diff line Loading @@ -1859,20 +1859,18 @@ static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr, bool ipv6_chk_custom_prefix(const struct in6_addr *addr, bool ipv6_chk_custom_prefix(const struct in6_addr *addr, const unsigned int prefix_len, struct net_device *dev) const unsigned int prefix_len, struct net_device *dev) { { struct inet6_dev *idev; const struct inet6_ifaddr *ifa; struct inet6_ifaddr *ifa; const struct inet6_dev *idev; bool ret = false; bool ret = false; rcu_read_lock(); rcu_read_lock(); idev = __in6_dev_get(dev); idev = __in6_dev_get(dev); if (idev) { if (idev) { read_lock_bh(&idev->lock); list_for_each_entry_rcu(ifa, &idev->addr_list, if_list) { list_for_each_entry(ifa, &idev->addr_list, if_list) { ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len); ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len); if (ret) if (ret) break; break; } } read_unlock_bh(&idev->lock); } } rcu_read_unlock(); rcu_read_unlock(); Loading