diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-10 23:26:00 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-10 23:26:00 +0100 |
commit | 33175d84ee3fa29991adb80513683e010769e807 (patch) | |
tree | 3731f61cf82451b6892cf1368701e57e35d92908 /net/core/dev.c | |
parent | tg3: Remove 5750 PCI code (diff) | |
parent | ip6ip6: autoload ip6 tunnel (diff) | |
download | linux-33175d84ee3fa29991adb80513683e010769e807.tar.xz linux-33175d84ee3fa29991adb80513683e010769e807.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bnx2x/bnx2x_cmn.c
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 9f66de9c0572..0d39032e9621 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1115,13 +1115,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); |