Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91988
b: refs/heads/master
c: 48abfe0
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Apr 24, 2008
1 parent 2e99fd1 commit 1a9f054
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 8c0469cdd08df4dacabc8ca33256ce20de43d73f
refs/heads/master: 48abfe05cd01279afe27159e98d7c7f932598f42
11 changes: 9 additions & 2 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,16 +668,23 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
break;

case TUNSETLINK:
{
int ret;

/* Only allow setting the type when the interface is down */
rtnl_lock();
if (tun->dev->flags & IFF_UP) {
DBG(KERN_INFO "%s: Linktype set failed because interface is up\n",
tun->dev->name);
return -EBUSY;
ret = -EBUSY;
} else {
tun->dev->type = (int) arg;
DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
ret = 0;
}
break;
rtnl_unlock();
return ret;
}

#ifdef TUN_DEBUG
case TUNSETDEBUG:
Expand Down

0 comments on commit 1a9f054

Please sign in to comment.