All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] ioctl: convert ioctl03 to new API
Date: Wed, 20 Dec 2017 11:27:48 +0100	[thread overview]
Message-ID: <20171220102748.GA6688@rei> (raw)
In-Reply-To: <CAEemH2eb8R8BAYV1_kw0KX=SH89HR5mevzHWK_nds+1m_zp0Fw@mail.gmail.com>

Hi!
> > After this change the test fails with TBROK instead of TCONF when the
> > ioctl() fails.
> >
> > I suppose that the tun driver can be compiled out of the kernel and that
> > we should still handle this situation as TCONF rather than TBROK. The
> > question is what kind of errno we get in that case, I suppose that it
> > may be ENOTTY but that should be tested.
> 
> Do you mean that ioctl(netfd, TUNGETFEATURES, &features) may be failed
> with erron==ENOTTY while testing on a kernel without TUN driver
> loaded?

That was my expectation, but with ioctl() you cannot be really sure.

> I tried that with kernel-4.15-rc4 but get "No Such Device" error when
> open "/dev/net/tun" file. And the worth to say, /dev/net/tun is still
> exist after removing TUN module.

Ok, then we need to handle ENODEV as TCONF there and anything else as
TBROK.

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2017-12-20 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  7:24 [LTP] [PATCH v2 1/2] ioctl: add two receive mode checking for TUN/TAP driver Li Wang
2017-12-14  7:24 ` [LTP] [PATCH v2 2/2] ioctl: convert ioctl03 to new API Li Wang
2017-12-19 13:41   ` Cyril Hrubis
2017-12-20 10:19     ` Li Wang
2017-12-20 10:27       ` Cyril Hrubis [this message]

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=20171220102748.GA6688@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.