summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-11 01:00:44 +0300
committerDavid S. Miller <davem@davemloft.net>2011-03-11 01:00:44 +0300
commitbef6e7e76868ab454d5e83635a4a7a1961c74fb5 (patch)
tree1a7417b9dde942cc71f87c02688c6ac6b0e57a72 /net/core
parentdcbcdf22f500ac6e4ec06485341024739b9dc241 (diff)
parent9179746652faf0aba07b8b7f770dcf29892a24c6 (diff)
downloadlinux-bef6e7e76868ab454d5e83635a4a7a1961c74fb5.tar.xz
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 8ae6631abcc2..6561021d22d1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1114,13 +1114,21 @@ EXPORT_SYMBOL(netdev_bonding_change);
void dev_load(struct net *net, const char *name)
{
struct net_device *dev;
+ int no_module;
rcu_read_lock();
dev = dev_get_by_name_rcu(net, name);
rcu_read_unlock();
- if (!dev && capable(CAP_NET_ADMIN))
- request_module("%s", name);
+ no_module = !dev;
+ if (no_module && capable(CAP_NET_ADMIN))
+ no_module = request_module("netdev-%s", name);
+ if (no_module && capable(CAP_SYS_MODULE)) {
+ if (!request_module("%s", name))
+ pr_err("Loading kernel module for a network device "
+"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s "
+"instead\n", name);
+ }
}
EXPORT_SYMBOL(dev_load);