From: Thomas Huth <thuth@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>, qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, jasowang@redhat.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH] slirp: Allow to disable IPv4 or IPv6
Date: Mon, 21 Mar 2016 08:33:45 +0100 [thread overview]
Message-ID: <56EFA3D9.1090404@redhat.com> (raw)
In-Reply-To: <1458473954-18583-1-git-send-email-samuel.thibault@ens-lyon.org>
On 20.03.2016 12:39, Samuel Thibault wrote:
> Make net=0.0.0.0 disable IPv4 and ip6-net=:: disable IPv6, so the user can
> setup IPv4-only and IPv6-only network environments.
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> net/slirp.c | 8 +++++---
> qapi-schema.json | 4 ++--
> qemu-options.hx | 7 ++++---
> slirp/ip6.h | 9 +++++++++
> slirp/ip6_icmp.c | 10 ++++++++++
> slirp/ip6_input.c | 6 ++++++
> slirp/ip_input.c | 5 +++++
> slirp/slirp.c | 5 +++++
> 8 files changed, 46 insertions(+), 8 deletions(-)
>
> diff --git a/net/slirp.c b/net/slirp.c
> index 95239bc..3151d4a 100644
> --- a/net/slirp.c
> +++ b/net/slirp.c
> @@ -244,13 +244,15 @@ static int net_slirp_init(NetClientState *peer, const char *model,
>
> #if defined(_WIN32) && (_WIN32_WINNT < 0x0600)
> /* No inet_pton helper before Vista... */
> - if (vprefix6) {
> + if (vprefix6 && strcmp(vprefix6, "::")) {
> /* Unsupported */
> return -1;
> }
> memset(&ip6_prefix, 0, sizeof(ip6_prefix));
> - ip6_prefix.s6_addr[0] = 0xfe;
> - ip6_prefix.s6_addr[1] = 0xc0;
> + if (!vprefix6) {
> + ip6_prefix.s6_addr[0] = 0xfe;
> + ip6_prefix.s6_addr[1] = 0xc0;
> + }
> #else
> if (!vprefix6) {
> vprefix6 = "fec0::";
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 88f9b81..69eb6e7 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -2427,7 +2427,7 @@
> #
> # @ip: #optional legacy parameter, use net= instead
> #
> -# @net: #optional IP address and optional netmask
> +# @net: #optional IP address and optional netmask. Set to 0.0.0.0 to disable IPv4 completely
> #
> # @host: #optional guest-visible address of the host
> #
> @@ -2443,7 +2443,7 @@
> # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
> # to the guest
> #
> -# @ip6-prefix: #optional IPv6 network prefix (default is fec0::) (since 2.6)
> +# @ip6-prefix: #optional IPv6 network prefix. Set to :: to disable IPv6 completely (default is fec0::) (since 2.6)
The new lines here seem to be longer than 80 characters ... I think you
should wrap them.
Apart from that, the patch looks fine to me.
Thomas
next prev parent reply other threads:[~2016-03-21 7:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-20 11:39 [Qemu-devel] [PATCH] slirp: Allow to disable IPv4 or IPv6 Samuel Thibault
2016-03-20 13:32 ` Samuel Thibault
2016-03-21 7:33 ` Thomas Huth [this message]
2016-03-21 7:33 ` Markus Armbruster
2016-03-21 9:02 ` Samuel Thibault
2016-03-21 9:44 ` Markus Armbruster
2016-03-21 23:55 ` Samuel Thibault
2016-03-22 7:41 ` Markus Armbruster
2016-03-22 8:02 ` Thomas Huth
2016-03-22 21:46 ` Samuel Thibault
2016-03-23 10:01 ` Markus Armbruster
2016-03-23 10:13 ` Daniel P. Berrange
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=56EFA3D9.1090404@redhat.com \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@ens-lyon.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).