Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78764
b: refs/heads/master
c: 06bfe65
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Lezcano authored and David S. Miller committed Jan 28, 2008
1 parent c2cbda8 commit 59f869e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfeade087005278fc8cafe230b7658a4f40c5acb
refs/heads/master: 06bfe655e7db7719c0eb51eb420fb9c2a6aa1e00
10 changes: 7 additions & 3 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);

static void inet6_prefix_notify(int event, struct inet6_dev *idev,
struct prefix_info *pinfo);
static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev);
static int ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
struct net_device *dev);

static ATOMIC_NOTIFIER_HEAD(inet6addr_chain);

Expand Down Expand Up @@ -560,7 +561,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
write_lock(&addrconf_hash_lock);

/* Ignore adding duplicate addresses on an interface */
if (ipv6_chk_same_addr(addr, idev->dev)) {
if (ipv6_chk_same_addr(&init_net, addr, idev->dev)) {
ADBG(("ipv6_add_addr: already assigned\n"));
err = -EEXIST;
goto out;
Expand Down Expand Up @@ -1229,12 +1230,15 @@ int ipv6_chk_addr(struct net *net, struct in6_addr *addr,
EXPORT_SYMBOL(ipv6_chk_addr);

static
int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev)
int ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
struct net_device *dev)
{
struct inet6_ifaddr * ifp;
u8 hash = ipv6_addr_hash(addr);

for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
if (ifp->idev->dev->nd_net != net)
continue;
if (ipv6_addr_equal(&ifp->addr, addr)) {
if (dev == NULL || ifp->idev->dev == dev)
break;
Expand Down

0 comments on commit 59f869e

Please sign in to comment.