diff options
Diffstat (limited to 'net/ipv6/anycast.c')
-rw-r--r-- | net/ipv6/anycast.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 09117d63256f..9b81264eb78f 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -423,14 +423,18 @@ static int ipv6_chk_acast_dev(struct net_device *dev, struct in6_addr *addr) | |||
423 | */ | 423 | */ |
424 | int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr) | 424 | int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr) |
425 | { | 425 | { |
426 | int found = 0; | ||
427 | |||
426 | if (dev) | 428 | if (dev) |
427 | return ipv6_chk_acast_dev(dev, addr); | 429 | return ipv6_chk_acast_dev(dev, addr); |
428 | read_lock(&dev_base_lock); | 430 | read_lock(&dev_base_lock); |
429 | for (dev=dev_base; dev; dev=dev->next) | 431 | for_each_netdev(dev) |
430 | if (ipv6_chk_acast_dev(dev, addr)) | 432 | if (ipv6_chk_acast_dev(dev, addr)) { |
433 | found = 1; | ||
431 | break; | 434 | break; |
435 | } | ||
432 | read_unlock(&dev_base_lock); | 436 | read_unlock(&dev_base_lock); |
433 | return dev != 0; | 437 | return found; |
434 | } | 438 | } |
435 | 439 | ||
436 | 440 | ||
@@ -447,9 +451,8 @@ static inline struct ifacaddr6 *ac6_get_first(struct seq_file *seq) | |||
447 | struct ifacaddr6 *im = NULL; | 451 | struct ifacaddr6 *im = NULL; |
448 | struct ac6_iter_state *state = ac6_seq_private(seq); | 452 | struct ac6_iter_state *state = ac6_seq_private(seq); |
449 | 453 | ||
450 | for (state->dev = dev_base, state->idev = NULL; | 454 | state->idev = NULL; |
451 | state->dev; | 455 | for_each_netdev(state->dev) { |
452 | state->dev = state->dev->next) { | ||
453 | struct inet6_dev *idev; | 456 | struct inet6_dev *idev; |
454 | idev = in6_dev_get(state->dev); | 457 | idev = in6_dev_get(state->dev); |
455 | if (!idev) | 458 | if (!idev) |
@@ -476,7 +479,7 @@ static struct ifacaddr6 *ac6_get_next(struct seq_file *seq, struct ifacaddr6 *im | |||
476 | read_unlock_bh(&state->idev->lock); | 479 | read_unlock_bh(&state->idev->lock); |
477 | in6_dev_put(state->idev); | 480 | in6_dev_put(state->idev); |
478 | } | 481 | } |
479 | state->dev = state->dev->next; | 482 | state->dev = next_net_device(state->dev); |
480 | if (!state->dev) { | 483 | if (!state->dev) { |
481 | state->idev = NULL; | 484 | state->idev = NULL; |
482 | break; | 485 | break; |