Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349623
b: refs/heads/master
c: af668b3
h: refs/heads/master
i:
  349621: 9795a4a
  349619: d44333f
  349615: 97e7913
v: v3
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Jan 29, 2013
1 parent 2b172d0 commit 041d3b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: 604dfd6efc9b79bce432f2394791708d8e8f6efc
refs/heads/master: af668b3c276d0f958a3aa46ef8ec47e2d5d333b3
13 changes: 8 additions & 5 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,13 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
}

if (clean) {
if (tun && tun->numqueues == 0 && tun->numdisabled == 0 &&
!(tun->flags & TUN_PERSIST))
if (tun->dev->reg_state == NETREG_REGISTERED)
if (tun && tun->numqueues == 0 && tun->numdisabled == 0) {
netif_carrier_off(tun->dev);

if (!(tun->flags & TUN_PERSIST) &&
tun->dev->reg_state == NETREG_REGISTERED)
unregister_netdevice(tun->dev);
}

BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED,
&tfile->socket.flags));
Expand Down Expand Up @@ -1658,10 +1661,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
device_create_file(&tun->dev->dev, &dev_attr_owner) ||
device_create_file(&tun->dev->dev, &dev_attr_group))
pr_err("Failed to create tun sysfs files\n");

netif_carrier_on(tun->dev);
}

netif_carrier_on(tun->dev);

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

if (ifr->ifr_flags & IFF_NO_PI)
Expand Down

0 comments on commit 041d3b4

Please sign in to comment.