dect
/
linux-2.6
Archived
13
0
Fork 0

tun: Return -EINVAL if neither IFF_TUN nor IFF_TAP is set.

After commit 2b980dbd77
("lsm: Add hooks to the TUN driver") tun_set_iff doesn't
return -EINVAL though neither IFF_TUN nor IFF_TAP is set.

Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kusanagi Kouichi 2009-09-16 21:36:13 +00:00 committed by David S. Miller
parent 9cc4085585
commit 36989b9087
1 changed files with 1 additions and 3 deletions

View File

@ -946,8 +946,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
char *name;
unsigned long flags = 0;
err = -EINVAL;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
err = security_tun_dev_create();
@ -964,7 +962,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
flags |= TUN_TAP_DEV;
name = "tap%d";
} else
goto failed;
return -EINVAL;
if (*ifr->ifr_name)
name = ifr->ifr_name;