diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-05 17:59:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-05 17:59:02 -0400 |
commit | 7143b7d41218d4fc2ea33e6056c73609527ae687 (patch) | |
tree | 9a842daee1deb57a2c8084bc5d300f6d8428fe34 /drivers/net/veth.c | |
parent | 90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (diff) | |
parent | 87e9af6cc67d842cd92b52b81f3f14e665e7ab05 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/tg3.c
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r-- | drivers/net/veth.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index cbe953a5bf5a..3b0151a2a31b 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -368,6 +368,17 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, | |||
368 | if (tb[IFLA_ADDRESS] == NULL) | 368 | if (tb[IFLA_ADDRESS] == NULL) |
369 | random_ether_addr(dev->dev_addr); | 369 | random_ether_addr(dev->dev_addr); |
370 | 370 | ||
371 | if (tb[IFLA_IFNAME]) | ||
372 | nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ); | ||
373 | else | ||
374 | snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d"); | ||
375 | |||
376 | if (strchr(dev->name, '%')) { | ||
377 | err = dev_alloc_name(dev, dev->name); | ||
378 | if (err < 0) | ||
379 | goto err_alloc_name; | ||
380 | } | ||
381 | |||
371 | err = register_netdevice(dev); | 382 | err = register_netdevice(dev); |
372 | if (err < 0) | 383 | if (err < 0) |
373 | goto err_register_dev; | 384 | goto err_register_dev; |
@@ -387,6 +398,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, | |||
387 | 398 | ||
388 | err_register_dev: | 399 | err_register_dev: |
389 | /* nothing to do */ | 400 | /* nothing to do */ |
401 | err_alloc_name: | ||
390 | err_configure_peer: | 402 | err_configure_peer: |
391 | unregister_netdevice(peer); | 403 | unregister_netdevice(peer); |
392 | return err; | 404 | return err; |