From: Paul Moore <paul.moore@hp.com>
To: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: tun: Return -EINVAL if neither IFF_TUN nor IFF_TAP is set.
Date: Fri, 18 Sep 2009 07:54:05 -0400 [thread overview]
Message-ID: <200909180754.05817.paul.moore@hp.com> (raw)
In-Reply-To: <20090917073614.15217260031@msa105lp.auone-net.jp>
On Thursday 17 September 2009 03:36:13 am Kusanagi Kouichi wrote:
> 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>
Sorry about that, my mistake, thanks for finding and fixing this.
Reviewed-by: Paul Moore <paul.moore@hp.com>
> ---
> drivers/net/tun.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 3f5d288..e091756 100644
> --- 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;
>
--
paul moore
linux @ hp
next prev parent reply other threads:[~2009-09-18 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 7:36 tun: Return -EINVAL if neither IFF_TUN nor IFF_TAP is set Kusanagi Kouichi
2009-09-18 11:54 ` Paul Moore [this message]
2009-09-22 21:26 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200909180754.05817.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=slash@ma.neweb.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).