diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-01-24 00:45:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-25 02:18:18 -0500 |
commit | 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 (patch) | |
tree | 92ae1276bf9e2a6be451f7e7bf4cc73486b0df42 /drivers/net/veth.c | |
parent | acd1130e8793fb150fb522da8ec51675839eb4b1 (diff) |
veth: remove unneeded ifname code from veth_newlink()
The code is not needed because tb[IFLA_IFNAME] is already
processed in rtnl_newlink(). Remove this redundancy.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r-- | drivers/net/veth.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index cc83fa71c3ff..105d7f0630cc 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -403,17 +403,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, | |||
403 | if (tb[IFLA_ADDRESS] == NULL) | 403 | if (tb[IFLA_ADDRESS] == NULL) |
404 | random_ether_addr(dev->dev_addr); | 404 | random_ether_addr(dev->dev_addr); |
405 | 405 | ||
406 | if (tb[IFLA_IFNAME]) | ||
407 | nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ); | ||
408 | else | ||
409 | snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d"); | ||
410 | |||
411 | if (strchr(dev->name, '%')) { | ||
412 | err = dev_alloc_name(dev, dev->name); | ||
413 | if (err < 0) | ||
414 | goto err_alloc_name; | ||
415 | } | ||
416 | |||
417 | err = register_netdevice(dev); | 406 | err = register_netdevice(dev); |
418 | if (err < 0) | 407 | if (err < 0) |
419 | goto err_register_dev; | 408 | goto err_register_dev; |
@@ -433,7 +422,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, | |||
433 | 422 | ||
434 | err_register_dev: | 423 | err_register_dev: |
435 | /* nothing to do */ | 424 | /* nothing to do */ |
436 | err_alloc_name: | ||
437 | err_configure_peer: | 425 | err_configure_peer: |
438 | unregister_netdevice(peer); | 426 | unregister_netdevice(peer); |
439 | return err; | 427 | return err; |