[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 1/4] Add basic version of bridge helper |
Date: |
Wed, 2 Nov 2011 10:58:45 +0000 |
On Tue, Nov 1, 2011 at 5:13 PM, Corey Bryant <address@hidden> 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
Re: [Qemu-devel] [PATCH v4 0/4] -net bridge: rootless bridge support for qemu, Zhi Yong Wu, 2011/11/08