qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Corey Bryant <coreyb@linux.vnet.ibm.com>
Cc: rmarwah@linux.vnet.ibm.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper
Date: Wed, 2 Nov 2011 10:58:45 +0000	[thread overview]
Message-ID: <CAJSP0QWgE=xC5Mod8Aj+aABLAfrvgN2xi4ZyPuJ0rZNreT9x4A@mail.gmail.com> (raw)
In-Reply-To: <1320167638-8895-2-git-send-email-coreyb@linux.vnet.ibm.com>

On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant <coreyb@linux.vnet.ibm.com> wrote:
> +static bool has_vnet_hdr(int fd)
> +{
> +    unsigned int features = 0;
> +    struct ifreq ifreq;
> +
> +    if (ioctl(fd, TUNGETFEATURES, &features) == -1) {
> +        return false;
> +    }
> +
> +    if (!(features & IFF_VNET_HDR)) {
> +        return false;
> +    }
> +
> +    if (ioctl(fd, TUNGETIFF, &ifreq) != -1 || errno != EBADFD) {
> +        return false;
> +    }

I don't understand this expression.  We want TUNGETIFF to fail with
EBADFD, otherwise we return false.  What is this trying to do?

Why do we even need TUNGETIFF after TUNGETFEATURES succeeded and we
were able to check out the IFF_VNET_HDR flag?

Stefan

  reply	other threads:[~2011-11-02 10:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 17:13 [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper Corey Bryant
2011-11-02 10:58   ` Stefan Hajnoczi [this message]
2011-11-02 15:12     ` Corey Bryant
2011-11-03  7:54       ` Stefan Hajnoczi
2011-11-03 13:11         ` Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 2/4] Add access control support to qemu " Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 3/4] Add cap reduction support to enable use as SUID Corey Bryant
2011-11-01 17:13 ` [Qemu-devel] [PATCH v4 4/4] Add support for net bridge Corey Bryant
2011-11-02  8:12   ` Mark Wu
2011-11-02 15:52     ` Corey Bryant
2011-11-08  6:46 ` [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu Zhi Yong Wu
2011-11-08 15:37   ` Corey Bryant

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='CAJSP0QWgE=xC5Mod8Aj+aABLAfrvgN2xi4ZyPuJ0rZNreT9x4A@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=coreyb@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rmarwah@linux.vnet.ibm.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).