summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorStephen Hemminger2009-06-12 21:02:50 +0200
committerDavid S. Miller2009-06-14 08:29:01 +0200
commit373500db927706d1f60785aff40b9884f789b01a (patch)
tree2a9fd664e6ae30c77a63576045c4eb182aaa7033 /drivers/net/bonding/bond_main.c
parentbonding: elminate bad refcount code (diff)
downloadkernel-qcow2-linux-373500db927706d1f60785aff40b9884f789b01a.tar.gz
kernel-qcow2-linux-373500db927706d1f60785aff40b9884f789b01a.tar.xz
kernel-qcow2-linux-373500db927706d1f60785aff40b9884f789b01a.zip
bonding: network device names are case sensative
The bonding device acts unlike all other Linux network device functions in that it ignores case of device names. The developer must have come from windows! Cleanup the management of names and use standard routines where possible. Flag places where bonding device still doesn't work right with network namespaces. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ea6b9043a5e7..a6e789172727 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5064,19 +5064,16 @@ static void bond_set_lockdep_class(struct net_device *dev)
int bond_create(const char *name)
{
struct net_device *bond_dev;
- struct bonding *bond;
int res;
rtnl_lock();
/* Check to see if the bond already exists. */
- if (name) {
- list_for_each_entry(bond, &bond_dev_list, bond_list)
- if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
- pr_err(DRV_NAME ": cannot add bond %s;"
- " it already exists\n", name);
- res = -EPERM;
- goto out_rtnl;
- }
+ /* FIXME: pass netns from caller */
+ if (name && __dev_get_by_name(&init_net, name)) {
+ pr_err(DRV_NAME ": cannot add bond %s; already exists\n",
+ name);
+ res = -EEXIST;
+ goto out_rtnl;
}
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",