Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341740
b: refs/heads/master
c: eb0fb36
h: refs/heads/master
v: v3
  • Loading branch information
Jason Wang authored and David S. Miller committed Dec 3, 2012
1 parent de3be2c commit 19160bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 092a5fc9636268bc2c0fef4d9b99845699cf19f9
refs/heads/master: eb0fb363f920e4d8c70d30b712f9dd433271218c
11 changes: 5 additions & 6 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,6 @@ static int tun_attach(struct tun_struct *tun, struct file *file)

tun_set_real_num_queues(tun);

if (tun->numqueues == 1)
netif_carrier_on(tun->dev);

/* device is allowed to go away first, so no need to hold extra
* refcnt.
*/
Expand Down Expand Up @@ -1612,6 +1609,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
TUN_USER_FEATURES;
dev->features = dev->hw_features;

err = tun_attach(tun, file);
if (err < 0)
goto err_free_dev;

err = register_netdevice(tun->dev);
if (err < 0)
goto err_free_dev;
Expand All @@ -1621,9 +1622,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
device_create_file(&tun->dev->dev, &dev_attr_group))
pr_err("Failed to create tun sysfs files\n");

err = tun_attach(tun, file);
if (err < 0)
goto err_free_dev;
netif_carrier_on(tun->dev);
}

tun_debug(KERN_INFO, tun, "tun_set_iff\n");
Expand Down

0 comments on commit 19160bc

Please sign in to comment.