projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9cc4085
)
tun: Return -EINVAL if neither IFF_TUN nor IFF_TAP is set.
author
Kusanagi Kouichi
<
[email protected]
>
Wed, 16 Sep 2009 21:36:13 +0000
(21:36 +0000)
committer
David S. Miller
<
[email protected]
>
Tue, 22 Sep 2009 21:00:16 +0000
(14:00 -0700)
After commit
2b980dbd77d229eb60588802162c9659726b11f4
("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 <
[email protected]
>
Reviewed-by: Paul Moore <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/tun.c
patch
|
blob
|
history
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index 3f5d28851aa20e4b175a05133faf27161f199f0c..e091756166a3ad9a069b57c9ca52c2a404c65dfb 100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-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;