From: Stefan Hajnoczi <stefanha@gmail.com>
To: Nikhil Balachandra <nikhilbalachandra.inbox@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] Make qemu-bridge-helper work in macOS and FreeBSD
Date: Mon, 16 Apr 2018 15:31:00 +0800 [thread overview]
Message-ID: <20180416073100.GA28904@stefanha-x1.localdomain> (raw)
In-Reply-To: <20180406194205.9872-1-nikhilbalachandra.inbox@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]
On Sat, Apr 07, 2018 at 01:12:05AM +0530, Nikhil Balachandra wrote:
> Eventhough macOS does not ship with the if_bridgevar.h header file[2],
> I expect the API to remain stable as this header file is similar to what
> is found in other BSDs. If this patch is decided to be included in the
> qemu, can experienced qemu developers please tell me how to go about
> having this header file in the include path such that it does not require
> manually downloading and copying the file[3]?
QEMU ships Linux headers. They are synced using this script:
scripts/update-linux-headers.sh
If the macOS header is appropriately licensed, it could be kept under
include/standard-headers/ alongside the other third-party headers that
QEMU ships.
> @@ -310,30 +374,18 @@ int main(int argc, char **argv)
> goto cleanup;
> }
>
> +
> /* open the tap device */
> - fd = open("/dev/net/tun", O_RDWR);
> + memset(&iface, '\0', sizeof(char) * IFNAMSIZ);
> + int vnet_supported = has_vnet_hdr(fd);
fd is always -1 here, so this patch breaks vnet hdr?
> + Error *err = NULL;
> + fd = tap_open(&iface[0], sizeof(iface), &vnet_supported, use_vnet, 0, &err);
tap_open() was not written with setuid programs in mind. I think this
is a case where code duplication is justified.
It's safer to have the minimal code to open the tap device rather than
calling into QEMU code which may not realize it is running setuid.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2018-04-16 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 19:42 [Qemu-devel] [PATCH 1/1] Make qemu-bridge-helper work in macOS and FreeBSD Nikhil Balachandra
2018-04-16 7:31 ` Stefan Hajnoczi [this message]
2018-04-17 4:27 ` Nikhil Balachandra
2018-04-20 8:48 ` Stefan Hajnoczi
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=20180416073100.GA28904@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=nikhilbalachandra.inbox@gmail.com \
--cc=qemu-devel@nongnu.org \
/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).