diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-10 17:26:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-10 17:26:00 -0500 |
commit | 33175d84ee3fa29991adb80513683e010769e807 (patch) | |
tree | 3731f61cf82451b6892cf1368701e57e35d92908 /net/core/dev.c | |
parent | c5908939b2738bafe1b309bc2465cb9f2e6184c5 (diff) | |
parent | 6dfbd87a20a737641ef228230c77f4262434fa24 (diff) |
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); | |||
1115 | void dev_load(struct net *net, const char *name) | 1115 | void dev_load(struct net *net, const char *name) |
1116 | { | 1116 | { |
1117 | struct net_device *dev; | 1117 | struct net_device *dev; |
1118 | int no_module; | ||
1118 | 1119 | ||
1119 | rcu_read_lock(); | 1120 | rcu_read_lock(); |
1120 | dev = dev_get_by_name_rcu(net, name); | 1121 | dev = dev_get_by_name_rcu(net, name); |
1121 | rcu_read_unlock(); | 1122 | rcu_read_unlock(); |
1122 | 1123 | ||
1123 | if (!dev && capable(CAP_NET_ADMIN)) | 1124 | no_module = !dev; |
1124 | request_module("%s", name); | 1125 | if (no_module && capable(CAP_NET_ADMIN)) |
1126 | no_module = request_module("netdev-%s", name); | ||
1127 | if (no_module && capable(CAP_SYS_MODULE)) { | ||
1128 | if (!request_module("%s", name)) | ||
1129 | pr_err("Loading kernel module for a network device " | ||
1130 | "with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s " | ||
1131 | "instead\n", name); | ||
1132 | } | ||
1125 | } | 1133 | } |
1126 | EXPORT_SYMBOL(dev_load); | 1134 | EXPORT_SYMBOL(dev_load); |
1127 | 1135 | ||