git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'stable/swiotlb-0.8.3' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git]
/
net
/
ipv6
/
addrconf.c
diff --git
a/net/ipv6/addrconf.c
b/net/ipv6/addrconf.c
index e1a698df5706a9bcff5889e4b734ad66d6dbfb55..784f34d11fdd2f5672949a8f31b302377e6e6fc7 100644
(file)
--- a/
net/ipv6/addrconf.c
+++ b/
net/ipv6/addrconf.c
@@
-1760,7
+1760,10
@@
static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
idev = ipv6_find_idev(dev);
if (!idev)
idev = ipv6_find_idev(dev);
if (!idev)
- return NULL;
+ return ERR_PTR(-ENOBUFS);
+
+ if (idev->cnf.disable_ipv6)
+ return ERR_PTR(-EACCES);
/* Add default multicast route */
addrconf_add_mroute(dev);
/* Add default multicast route */
addrconf_add_mroute(dev);
@@
-2129,8
+2132,9
@@
static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
if (!dev)
return -ENODEV;
if (!dev)
return -ENODEV;
- if ((idev = addrconf_add_dev(dev)) == NULL)
- return -ENOBUFS;
+ idev = addrconf_add_dev(dev);
+ if (IS_ERR(idev))
+ return PTR_ERR(idev);
scope = ipv6_addr_scope(pfx);
scope = ipv6_addr_scope(pfx);
@@
-2377,7
+2381,7
@@
static void addrconf_dev_config(struct net_device *dev)
}
idev = addrconf_add_dev(dev);
}
idev = addrconf_add_dev(dev);
- if (
idev == NULL
)
+ if (
IS_ERR(idev)
)
return;
memset(&addr, 0, sizeof(struct in6_addr));
return;
memset(&addr, 0, sizeof(struct in6_addr));
@@
-2468,7
+2472,7
@@
static void addrconf_ip6_tnl_config(struct net_device *dev)
ASSERT_RTNL();
idev = addrconf_add_dev(dev);
ASSERT_RTNL();
idev = addrconf_add_dev(dev);
- if (
!idev
) {
+ if (
IS_ERR(idev)
) {
printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
return;
}
printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
return;
}