Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90744
b: refs/heads/master
c: fc54c65
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 16, 2008
1 parent 7051f58 commit 7321290
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d647a591dae06ccc96210cea938aa0342ef935fc
refs/heads/master: fc54c65853dbfd2f70ff827b73344f9de4e4b501
4 changes: 4 additions & 0 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ static void tun_setup(struct net_device *dev)
dev->stop = tun_net_close;
dev->ethtool_ops = &tun_ethtool_ops;
dev->destructor = free_netdev;
dev->features |= NETIF_F_NETNS_LOCAL;
}

static struct tun_struct *tun_get_by_name(struct tun_net *tn, const char *name)
Expand Down Expand Up @@ -544,6 +545,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (!dev)
return -ENOMEM;

dev_net_set(dev, net);
tun = netdev_priv(dev);
tun->dev = dev;
tun->flags = flags;
Expand Down Expand Up @@ -583,6 +585,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)

file->private_data = tun;
tun->attached = 1;
get_net(dev_net(tun->dev));

strcpy(ifr->ifr_name, tun->dev->name);
return 0;
Expand Down Expand Up @@ -798,6 +801,7 @@ static int tun_chr_close(struct inode *inode, struct file *file)
/* Detach from net device */
file->private_data = NULL;
tun->attached = 0;
put_net(dev_net(tun->dev));

/* Drop read queue */
skb_queue_purge(&tun->readq);
Expand Down

0 comments on commit 7321290

Please sign in to comment.