netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev@vger.kernel.org
Subject: Re: [iproute2 patch]: Add 'ip tuntap' facility for managing tun/tap devices
Date: Sat, 13 Jun 2009 09:55:25 +0100	[thread overview]
Message-ID: <1244883325.3468.39.camel@macbook.infradead.org> (raw)
In-Reply-To: <1243498369.18507.83.camel@macbook.infradead.org>

On Thu, 2009-05-28 at 09:12 +0100, David Woodhouse wrote:
> On Wed, 2009-05-27 at 21:58 -0700, Stephen Hemminger wrote:
> > > +#define TUNDEV "/dev/net/tun"
> > 
> > I know this is historical legacy, but how does this play with
> network namespaces?
> 
> For /dev/net/tun itself, it doesn't need to. The namespaces come into
> play when you issue the TUNSETIFF ioctl to create/attach a particular
> named device, which uses the network namespace of the process which
> opened /dev/net/tun.
>  
> > > +static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid)
> > > +{
> > > +   int fd = open(TUNDEV, O_RDWR);
> > > +   int ret = -1;
> > > +
> > > +#ifndef IFF_TUN_EXCL
> > > +#define IFF_TUN_EXCL       0x8000
> > > +#endif
> > 
> > This shouldn't be here.
> > It should be defined in include/linux/if_tun.h in kernel source
> > and then a kernel sanitized version of if_tun.h should be put
> > in iproute2 source for backwards compatibility.
> 
> I'm happy to do that; I was just taking my lead from the handling of
> RTAX_RTTVAR, IP_DF, IPPROTO_SCTP, IPPPROTO_DCCP and IPPROTO_MH in
> ip/*.c
> 
> >  But why bother it doesn't seem to be defined or used by current
> kernel??
> 
> It's in net-next and is harmless in older kernels. It just means you
> can't accidentally 'create' a device which already existed.
> 
> > Would prefer open() next to the test.
> 
> OK, moved.
> 
> > > +     while (argc > 0) {
> > > +             if (strcmp(*argv, "mode") == 0) {
> > 
> > The argument parsing in ip commands uses matches() rather than
> strcmp
> > to allow for partial completion.  
> 
> OK. I had copied that part from 'ip tunnel', which uses strcmp().
> 
> New patch...

Ping?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


  reply	other threads:[~2009-06-13  8:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 10:32 tun: add tun_flags, owner, group attributes in sysfs David Woodhouse
2009-05-04 10:36 ` Michael Tokarev
2009-05-05 22:18   ` David Woodhouse
2009-05-04 10:42 ` [iproute2 patch]: Add 'ip tuntap' facility for managing tun/tap devices David Woodhouse
2009-05-04 14:38   ` Stephen Hemminger
2009-05-04 14:49     ` David Woodhouse
2009-05-27 16:32       ` David Woodhouse
2009-05-27 16:38         ` Stephen Hemminger
2009-05-27 16:49           ` David Woodhouse
2009-05-27 17:06             ` Stephen Hemminger
2009-05-27 20:44               ` David Miller
2009-05-27 20:43             ` David Miller
2009-05-28  4:58   ` Stephen Hemminger
2009-05-28  8:12     ` David Woodhouse
2009-06-13  8:55       ` David Woodhouse [this message]
2009-07-20 23:44         ` David Woodhouse
2009-05-04 14:47 ` tun: add tun_flags, owner, group attributes in sysfs Stephen Hemminger
2009-05-04 14:58   ` David Woodhouse
2009-05-09 20:27 ` David Miller
2009-05-09 22:27   ` David Woodhouse
2009-05-09 22:55     ` David Woodhouse
2009-05-09 22:56     ` David Miller
2009-05-10  5:54 ` 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=1244883325.3468.39.camel@macbook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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).