lkml.org 
[lkml]   [2009]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 29/37] tun: Return -EINVAL if neither IFF_TUN nor IFF_TAP is set.
2.6.31-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Kusanagi Kouichi <slash@ma.neweb.ne.jp>

[ Upstream commit 36989b90879c785f95b877bdcf65a2527dadd893 ]

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 <slash@ma.neweb.ne.jp>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/tun.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -943,8 +943,6 @@ static int tun_set_iff(struct net *net,
char *name;
unsigned long flags = 0;

- err = -EINVAL;
-
if (!capable(CAP_NET_ADMIN))
return -EPERM;

@@ -958,7 +956,7 @@ static int tun_set_iff(struct net *net,
flags |= TUN_TAP_DEV;
name = "tap%d";
} else
- goto failed;
+ return -EINVAL;

if (*ifr->ifr_name)
name = ifr->ifr_name;



\
 
 \ /
  Last update: 2009-10-10 02:03    [W:0.538 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site