aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 84127d854cfc..8b6875f02039 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -578,6 +578,13 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
578 struct rt6_info *rt; 578 struct rt6_info *rt;
579 int hash; 579 int hash;
580 int err = 0; 580 int err = 0;
581 int addr_type = ipv6_addr_type(addr);
582
583 if (addr_type == IPV6_ADDR_ANY ||
584 addr_type & IPV6_ADDR_MULTICAST ||
585 (!(idev->dev->flags & IFF_LOOPBACK) &&
586 addr_type & IPV6_ADDR_LOOPBACK))
587 return ERR_PTR(-EADDRNOTAVAIL);
581 588
582 rcu_read_lock_bh(); 589 rcu_read_lock_bh();
583 if (idev->dead) { 590 if (idev->dead) {