From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/2] net: Add -ipv6-hostfwd option, ipv6_hostfwd_add/remove commands
Date: Thu, 4 Feb 2021 09:57:38 +0000 [thread overview]
Message-ID: <20210204095738.GD549438@redhat.com> (raw)
In-Reply-To: <20210203213729.1940893-3-dje@google.com>
On Wed, Feb 03, 2021 at 01:37:29PM -0800, dje--- via wrote:
> These are identical to their ipv4 counterparts, but for ipv6.
>
> Signed-off-by: Doug Evans <dje@google.com>
> ---
> hmp-commands.hx | 28 ++++++++++
> include/net/slirp.h | 2 +
> net/slirp.c | 129 +++++++++++++++++++++++++++++++++++++++++++-
> qapi/net.json | 4 ++
> 4 files changed, 161 insertions(+), 2 deletions(-)
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index d4001f9c5d..bd51173472 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1392,6 +1392,34 @@ SRST
> Remove host-to-guest TCP or UDP redirection.
> ERST
>
> +#ifdef CONFIG_SLIRP
> + {
> + .name = "ipv6_hostfwd_add",
> + .args_type = "arg1:s,arg2:s?",
> + .params = "[netdev_id] [tcp|udp]:[hostaddr6]:hostport-[guestaddr6]:guestport",
> + .help = "redirect TCP6 or UDP6 connections from host to guest (requires -net user)",
> + .cmd = hmp_ipv6_hostfwd_add,
> + },
> +#endif
> +SRST
> +``ipv6_hostfwd_add``
> + Redirect TCP6 or UDP6 connections from host to guest (requires -net user).
> +ERST
> +
> +#ifdef CONFIG_SLIRP
> + {
> + .name = "ipv6_hostfwd_remove",
> + .args_type = "arg1:s,arg2:s?",
> + .params = "[netdev_id] [tcp|udp]:[hostaddr6]:hostport",
> + .help = "remove host-to-guest TCP6 or UDP6 redirection",
> + .cmd = hmp_ipv6_hostfwd_remove,
> + },
> +#endif
> +SRST
> +``ipv6_hostfwd_remove``
> + Remove host-to-guest TCP6 or UDP6 redirection.
> +ERST
DO we really need new commands for this ? It seems to me that we
can reliably distinction IPv4 vs v6 from the address format, and
thus existing commands can be adapted to support both.
This is the way other command line options and monitor commands
work for IPv4 vs IPv6 elsewhere in QEMU, so I think consistency
is beneficial. We already have the helper method inet_parse()
that can do this parsing.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-02-04 10:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 21:37 [PATCH v2 0/2] Add support for ipv6 host forwarding dje--- via
2021-02-03 21:37 ` [PATCH v2 1/2] net/slirp.c: Refactor address parsing dje--- via
2021-02-03 21:39 ` Doug Evans
2021-02-03 22:15 ` Samuel Thibault
2021-02-03 22:31 ` Doug Evans
2021-02-08 11:09 ` Philippe Mathieu-Daudé
2021-02-08 18:59 ` Doug Evans
2021-02-28 22:44 ` Samuel Thibault
2021-02-03 21:37 ` [PATCH v2 2/2] net: Add -ipv6-hostfwd option, ipv6_hostfwd_add/remove commands dje--- via
2021-02-03 22:20 ` Samuel Thibault
2021-02-03 22:29 ` Doug Evans
2021-02-04 9:57 ` Daniel P. Berrangé [this message]
2021-02-03 21:45 ` [PATCH v2 0/2] 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=20210204095738.GD549438@redhat.com \
--to=berrange@redhat.com \
--cc=dje@google.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).