diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-06-12 15:02:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-14 02:29:01 -0400 |
commit | 373500db927706d1f60785aff40b9884f789b01a (patch) | |
tree | 2a9fd664e6ae30c77a63576045c4eb182aaa7033 /drivers/net/bonding/bond_main.c | |
parent | 6d7ab43ccce5fddeca945ba6b06ba32cda4e3355 (diff) |
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.c | 15 |
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) | |||
5064 | int bond_create(const char *name) | 5064 | int bond_create(const char *name) |
5065 | { | 5065 | { |
5066 | struct net_device *bond_dev; | 5066 | struct net_device *bond_dev; |
5067 | struct bonding *bond; | ||
5068 | int res; | 5067 | int res; |
5069 | 5068 | ||
5070 | rtnl_lock(); | 5069 | rtnl_lock(); |
5071 | /* Check to see if the bond already exists. */ | 5070 | /* Check to see if the bond already exists. */ |
5072 | if (name) { | 5071 | /* FIXME: pass netns from caller */ |
5073 | list_for_each_entry(bond, &bond_dev_list, bond_list) | 5072 | if (name && __dev_get_by_name(&init_net, name)) { |
5074 | if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) { | 5073 | pr_err(DRV_NAME ": cannot add bond %s; already exists\n", |
5075 | pr_err(DRV_NAME ": cannot add bond %s;" | 5074 | name); |
5076 | " it already exists\n", name); | 5075 | res = -EEXIST; |
5077 | res = -EPERM; | 5076 | goto out_rtnl; |
5078 | goto out_rtnl; | ||
5079 | } | ||
5080 | } | 5077 | } |
5081 | 5078 | ||
5082 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", | 5079 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", |