From: Doug Evans <dje@google.com>
To: Samuel Thibault <samuel.thibault@gnu.org>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Marc-André Lureau" <marcandre.lureau@gmail.com>
Subject: Re: [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse
Date: Sun, 14 Mar 2021 12:52:55 -0700 [thread overview]
Message-ID: <CADPb22QyMDfwDzaLk1711X+SYxvSKR=m8NTHM1==rkXGLkjoNA@mail.gmail.com> (raw)
In-Reply-To: <20210306192912.wzs5d7pynxztnvxb@begin>
[-- Attachment #1: Type: text/plain, Size: 2843 bytes --]
On Sat, Mar 6, 2021 at 11:29 AM Samuel Thibault <samuel.thibault@gnu.org>
wrote:
> Hello,
>
> Doug Evans, le ven. 05 mars 2021 17:00:13 -0800, a ecrit:
> > Is it possible for QEMU to lazily determine the guest's IPv6
> > address? I.e., postpone the ""->guest address mapping until it's
> > needed and then, say, take the first entry in the NDP table?
>
> That would probably be possible, yes, by moving the
>
> if (!guest_addr.s_addr) {
> guest_addr = slirp->vdhcp_startaddr;
> }
>
> from slirp_add_hostfwd() and alike to tcp_connect() and sorecvfrom()
> (along the other sotranslate call).
>
> > That feels a bit fragile: what if someone else gets the first entry in
> > the NDP table? But is that any more fragile than assuming the first
> > handed out DHCP address is to the guest?
>
> I don't think it's really more fragile.
>
Good to know, thanks.
> > [<<-- Honest question, can we assume the first handed out DHCP address
> > will necessarily be the guest?]
>
> It "cannot" be anything else. What could happen is a PXE loader that
> uses DHCP/NDP, and then the OS that does it again.
>
> > But that would mean the defaults for the guest would have to be
> > different than for the host. E.g.,
> > host: ",ipv4" means both,
>
> Why would it mean both? I don't follow you here.
>
> > whereas guest: ",ipv4" (ideally) means ipv4 (since both is meaningless)
>
I guess one has to define:
- how these flags work,
- do they have defaults,
- and if they do have defaults what is the default value?
For the host, neither flag present means "both are on", which could mean,
effectively, that the defaults for
ipv4[={off,on}] and ipv6[={off,on}] are both "on".
[Assuming they have defaults. See above: Do they?
For the guest ipv4=on,ipv6=on is an error.]
But does that then mean that the presence of only "ipv4=on" or "ipv6=on" is
a no-op?
After all, why specify "ipv4=on" at all if it's the default?
I think a reader would get confused if they saw only one of "ipv4=on" or
"ipv6=on"
specified and learned that both were on.
It also means that to specify only one of ipv4 or ipv6 you have to turn the
other off.
It's a bit awkward, but it is consistent and easy to explain (if awkward to
use and read).
On the other hand, for the host, one could, for example,
make these flags tri-state (or call it whatever).
Is specifying only "ipv4=off" the equivalent of specifying only "ipv6=on"?
Presumably it must (it makes the most sense).
There is also the invalid setting of ipv4=off,ipv6=off.
One also needs to specify the order in which the flags are processed,
to define what ipv6=on,ipv6=off means.
Either that or document that specifying them multiple times is undefined.
This is getting a bit verbose to have to explain in documentation,
but it is what it is.
I don't have a say in the decision. I just need to know what to implement.
[-- Attachment #2: Type: text/html, Size: 5508 bytes --]
next prev parent reply other threads:[~2021-03-14 19:54 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 20:15 [PATCH v4 0/4] Add support for ipv6 host forwarding Doug Evans via
2021-02-18 20:15 ` [PATCH v4 1/4] slirp: Advance libslirp submodule to add ipv6 host-forward support Doug Evans via
2021-02-19 9:38 ` Daniel P. Berrangé
2021-02-19 21:43 ` Doug Evans
2021-02-18 20:15 ` [PATCH v4 2/4] util/qemu-sockets.c: Split host:port parsing out of inet_parse Doug Evans via
2021-02-19 10:00 ` Daniel P. Berrangé
2021-02-19 22:17 ` Doug Evans
2021-02-22 9:39 ` Daniel P. Berrangé
2021-02-23 18:23 ` Doug Evans
2021-02-28 21:39 ` Samuel Thibault
2021-02-28 22:20 ` Samuel Thibault
2021-03-01 8:15 ` Markus Armbruster
2021-03-01 8:31 ` Samuel Thibault
2021-03-01 16:07 ` Doug Evans
2021-03-01 16:26 ` Samuel Thibault
2021-03-01 20:39 ` Samuel Thibault
2021-03-01 16:23 ` Doug Evans
2021-03-01 16:27 ` Samuel Thibault
2021-03-01 21:05 ` Samuel Thibault
2021-03-03 18:06 ` Doug Evans
2021-03-03 18:11 ` Daniel P. Berrangé
2021-03-05 21:28 ` Samuel Thibault
2021-03-05 21:51 ` Doug Evans
2021-03-05 22:21 ` Doug Evans
2021-03-06 0:05 ` Doug Evans
2021-03-06 0:10 ` Samuel Thibault
2021-03-06 1:00 ` Doug Evans
2021-03-06 19:29 ` Samuel Thibault
2021-03-14 19:52 ` Doug Evans [this message]
2021-02-18 20:15 ` [PATCH v4 3/4] net/slirp.c: Refactor address parsing Doug Evans via
2021-02-18 20:15 ` [PATCH v4 4/4] net: Extend host forwarding to support IPv6 Doug Evans via
2021-02-18 20:34 ` [PATCH v4 0/4] Add support for ipv6 host forwarding no-reply
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='CADPb22QyMDfwDzaLk1711X+SYxvSKR=m8NTHM1==rkXGLkjoNA@mail.gmail.com' \
--to=dje@google.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@gnu.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).