diff options
| -rw-r--r-- | net/ipv6/addrconf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3984f52181f4..75d3b8c1e856 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -1274,7 +1274,7 @@ static int ipv6_count_addresses(struct inet6_dev *idev) | |||
| 1274 | int ipv6_chk_addr(struct net *net, struct in6_addr *addr, | 1274 | int ipv6_chk_addr(struct net *net, struct in6_addr *addr, |
| 1275 | struct net_device *dev, int strict) | 1275 | struct net_device *dev, int strict) |
| 1276 | { | 1276 | { |
| 1277 | struct inet6_ifaddr *ifp = NULL; | 1277 | struct inet6_ifaddr *ifp; |
| 1278 | struct hlist_node *node; | 1278 | struct hlist_node *node; |
| 1279 | unsigned int hash = ipv6_addr_hash(addr); | 1279 | unsigned int hash = ipv6_addr_hash(addr); |
| 1280 | 1280 | ||
| @@ -1283,15 +1283,16 @@ int ipv6_chk_addr(struct net *net, struct in6_addr *addr, | |||
| 1283 | if (!net_eq(dev_net(ifp->idev->dev), net)) | 1283 | if (!net_eq(dev_net(ifp->idev->dev), net)) |
| 1284 | continue; | 1284 | continue; |
| 1285 | if (ipv6_addr_equal(&ifp->addr, addr) && | 1285 | if (ipv6_addr_equal(&ifp->addr, addr) && |
| 1286 | !(ifp->flags&IFA_F_TENTATIVE)) { | 1286 | !(ifp->flags&IFA_F_TENTATIVE) && |
| 1287 | if (dev == NULL || ifp->idev->dev == dev || | 1287 | (dev == NULL || ifp->idev->dev == dev || |
| 1288 | !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) | 1288 | !(ifp->scope&(IFA_LINK|IFA_HOST) || strict))) { |
| 1289 | break; | 1289 | rcu_read_unlock_bh(); |
| 1290 | return 1; | ||
| 1290 | } | 1291 | } |
| 1291 | } | 1292 | } |
| 1292 | rcu_read_unlock_bh(); | ||
| 1293 | 1293 | ||
| 1294 | return ifp != NULL; | 1294 | rcu_read_unlock_bh(); |
| 1295 | return 0; | ||
| 1295 | } | 1296 | } |
| 1296 | EXPORT_SYMBOL(ipv6_chk_addr); | 1297 | EXPORT_SYMBOL(ipv6_chk_addr); |
| 1297 | 1298 | ||
