mbox series

[v7,0/4] Add support for ipv6 host forwarding

Message ID 20210528235331.3727583-1-dje@google.com (mailing list archive)
Headers show
Series Add support for ipv6 host forwarding | expand

Message

Doug Evans May 28, 2021, 11:53 p.m. UTC
This patchset takes the original patch from Maxim,
https://www.mail-archive.com/qemu-devel@nongnu.org/msg569573.html
and updates it.

Option hostfwd is extended to support ipv6 addresses.
Commands hostfwd_add, hostfwd_remove are extended as well.

Changes from v6:

1/4: Update to use libslirp v4.5.0 tag

The libslirp parts of the patch have been committed to the libslirp repo,
and are now in QEMU's copy of the libslirp repo.
Advancing QEMU to use Libslirp v4.5.0 is being done separately.
Discussion of patch 1/4 is left to that thread:
https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06010.html

2/4: No change

3/4: Add support for --enable-slirp=system
Tested with system libslirp 4.4.0.

4/4: No change

Changes from v5:

1/4 slirp: Advance libslirp submodule to current master
NOTE TO REVIEWERS: It may be a better use of everyone's time if a
maintainer takes on advancing QEMU's libslirp to libslirp's master.
Beyond that, I really don't know what to do except submit this patch as
is currently provided.

2/4: util/qemu-sockets.c: Split host:port parsing out of inet_parse

Also split out parsing of ipv4=on|off, ipv6=on|off

3/4: net/slirp.c: Refactor address parsing

Use InetSocketAddress and getaddrinfo().
Use new libslirp calls: slirp_remove_hostxfwd, slirp_add_hostxfwd.

4/4: net: Extend host forwarding to support IPv6

Recognize ipv4=,ipv6= options.

Note: v5's 3/5 "Recognize []:port (empty ipv6 address)" has been deleted:
the churn on this patch series needs to be reduced.
This change is not required, and can easily be done in a later patch.

Changes from v4:

1/5 slirp: Advance libslirp submodule to add ipv6 host-forward support
NOTE TO REVIEWERS: I need some hand-holding to know what The Right
way to submit this particular patch is.

- no change

2/5 util/qemu-sockets.c: Split host:port parsing out of inet_parse

- move recognition of "[]:port" to separate patch
- allow passing NULL for ip_v6
- fix some formatting issues

3/5 inet_parse_host_and_addr: Recognize []:port (empty ipv6 address)

- new in this patchset revision

4/5 net/slirp.c: Refactor address parsing

- was 3/4 in v4
- fix some formatting issues

5/5 net: Extend host forwarding to support IPv6

- was 4/4 in v4
- fix some formatting issues

Changes from v3:

1/4 slirp: Advance libslirp submodule to add ipv6 host-forward support

- pick up latest libslirp patch to reject ipv6 addr-any for guest address
  - libslirp currently only provides a stateless DHCPv6 server, which means
    it can't know in advance what the guest's IP address is, and thus
    cannot do the "addr-any -> guest ip address" translation that is done
    for ipv4

2/4 util/qemu-sockets.c: Split host:port parsing out of inet_parse

- this patch is new in v4
  - provides new utility: inet_parse_host_and_port, updates inet_parse
    to use it

3/4 net/slirp.c: Refactor address parsing

- this patch renamed from 2/3 to 3/4
- call inet_parse_host_and_port from util/qemu-sockets.c
- added tests/acceptance/hostfwd.py

4/4 net: Extend host forwarding to support IPv6

- this patch renamed from 3/3 to 4/4
- ipv6 support added to existing hostfwd option, commands
  - instead of creating new ipv6 option, commands
- added tests to tests/acceptance/hostfwd.py

Changes from v2:
- split out libslirp commit
- clarify spelling of ipv6 addresses in docs
- tighten parsing of ipv6 addresses

Change from v1:
- libslirp part is now upstream
- net/slirp.c changes split into two pieces (refactor, add ipv6)
- added docs

Doug Evans (4):
  slirp: Advance libslirp submodule to 4.5 release
  util/qemu-sockets.c: Split host:port parsing out of inet_parse
  net/slirp.c: Refactor address parsing
  net: Extend host forwarding to support IPv6

 hmp-commands.hx             |  18 ++-
 include/qemu/sockets.h      |   5 +
 net/slirp.c                 | 272 ++++++++++++++++++++++++++++--------
 slirp                       |   2 +-
 tests/acceptance/hostfwd.py | 185 ++++++++++++++++++++++++
 util/qemu-sockets.c         |  82 +++++++----
 6 files changed, 473 insertions(+), 91 deletions(-)
 create mode 100644 tests/acceptance/hostfwd.py

Comments

Doug Evans June 10, 2021, 1:41 a.m. UTC | #1
Ping.

On Fri, May 28, 2021 at 4:53 PM Doug Evans <dje@google.com> wrote:

> This patchset takes the original patch from Maxim,
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg569573.html
> and updates it.
>
> Option hostfwd is extended to support ipv6 addresses.
> Commands hostfwd_add, hostfwd_remove are extended as well.
>
> Changes from v6:
>
> 1/4: Update to use libslirp v4.5.0 tag
>
> The libslirp parts of the patch have been committed to the libslirp repo,
> and are now in QEMU's copy of the libslirp repo.
> Advancing QEMU to use Libslirp v4.5.0 is being done separately.
> Discussion of patch 1/4 is left to that thread:
> https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06010.html
>
> 2/4: No change
>
> 3/4: Add support for --enable-slirp=system
> Tested with system libslirp 4.4.0.
>
> 4/4: No change
>
> Changes from v5:
>
> 1/4 slirp: Advance libslirp submodule to current master
> NOTE TO REVIEWERS: It may be a better use of everyone's time if a
> maintainer takes on advancing QEMU's libslirp to libslirp's master.
> Beyond that, I really don't know what to do except submit this patch as
> is currently provided.
>
> 2/4: util/qemu-sockets.c: Split host:port parsing out of inet_parse
>
> Also split out parsing of ipv4=on|off, ipv6=on|off
>
> 3/4: net/slirp.c: Refactor address parsing
>
> Use InetSocketAddress and getaddrinfo().
> Use new libslirp calls: slirp_remove_hostxfwd, slirp_add_hostxfwd.
>
> 4/4: net: Extend host forwarding to support IPv6
>
> Recognize ipv4=,ipv6= options.
>
> Note: v5's 3/5 "Recognize []:port (empty ipv6 address)" has been deleted:
> the churn on this patch series needs to be reduced.
> This change is not required, and can easily be done in a later patch.
>
> Changes from v4:
>
> 1/5 slirp: Advance libslirp submodule to add ipv6 host-forward support
> NOTE TO REVIEWERS: I need some hand-holding to know what The Right
> way to submit this particular patch is.
>
> - no change
>
> 2/5 util/qemu-sockets.c: Split host:port parsing out of inet_parse
>
> - move recognition of "[]:port" to separate patch
> - allow passing NULL for ip_v6
> - fix some formatting issues
>
> 3/5 inet_parse_host_and_addr: Recognize []:port (empty ipv6 address)
>
> - new in this patchset revision
>
> 4/5 net/slirp.c: Refactor address parsing
>
> - was 3/4 in v4
> - fix some formatting issues
>
> 5/5 net: Extend host forwarding to support IPv6
>
> - was 4/4 in v4
> - fix some formatting issues
>
> Changes from v3:
>
> 1/4 slirp: Advance libslirp submodule to add ipv6 host-forward support
>
> - pick up latest libslirp patch to reject ipv6 addr-any for guest address
>   - libslirp currently only provides a stateless DHCPv6 server, which means
>     it can't know in advance what the guest's IP address is, and thus
>     cannot do the "addr-any -> guest ip address" translation that is done
>     for ipv4
>
> 2/4 util/qemu-sockets.c: Split host:port parsing out of inet_parse
>
> - this patch is new in v4
>   - provides new utility: inet_parse_host_and_port, updates inet_parse
>     to use it
>
> 3/4 net/slirp.c: Refactor address parsing
>
> - this patch renamed from 2/3 to 3/4
> - call inet_parse_host_and_port from util/qemu-sockets.c
> - added tests/acceptance/hostfwd.py
>
> 4/4 net: Extend host forwarding to support IPv6
>
> - this patch renamed from 3/3 to 4/4
> - ipv6 support added to existing hostfwd option, commands
>   - instead of creating new ipv6 option, commands
> - added tests to tests/acceptance/hostfwd.py
>
> Changes from v2:
> - split out libslirp commit
> - clarify spelling of ipv6 addresses in docs
> - tighten parsing of ipv6 addresses
>
> Change from v1:
> - libslirp part is now upstream
> - net/slirp.c changes split into two pieces (refactor, add ipv6)
> - added docs
>
> Doug Evans (4):
>   slirp: Advance libslirp submodule to 4.5 release
>   util/qemu-sockets.c: Split host:port parsing out of inet_parse
>   net/slirp.c: Refactor address parsing
>   net: Extend host forwarding to support IPv6
>
>  hmp-commands.hx             |  18 ++-
>  include/qemu/sockets.h      |   5 +
>  net/slirp.c                 | 272 ++++++++++++++++++++++++++++--------
>  slirp                       |   2 +-
>  tests/acceptance/hostfwd.py | 185 ++++++++++++++++++++++++
>  util/qemu-sockets.c         |  82 +++++++----
>  6 files changed, 473 insertions(+), 91 deletions(-)
>  create mode 100644 tests/acceptance/hostfwd.py
>
> --
> 2.32.0.rc0.204.g9fa02ecfa5-goog
>
>
Doug Evans June 15, 2021, 11:24 a.m. UTC | #2
Ping.

On Wed, Jun 9, 2021 at 9:41 PM Doug Evans <dje@google.com> wrote:

> Ping.
>
> On Fri, May 28, 2021 at 4:53 PM Doug Evans <dje@google.com> wrote:
>
>> This patchset takes the original patch from Maxim,
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg569573.html
>> and updates it.
>>
>> Option hostfwd is extended to support ipv6 addresses.
>> Commands hostfwd_add, hostfwd_remove are extended as well.
>>
>> Changes from v6:
>>
>> 1/4: Update to use libslirp v4.5.0 tag
>>
>> The libslirp parts of the patch have been committed to the libslirp repo,
>> and are now in QEMU's copy of the libslirp repo.
>> Advancing QEMU to use Libslirp v4.5.0 is being done separately.
>> Discussion of patch 1/4 is left to that thread:
>> https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06010.html
>>
>> 2/4: No change
>>
>> 3/4: Add support for --enable-slirp=system
>> Tested with system libslirp 4.4.0.
>>
>> 4/4: No change
>>
>> Changes from v5:
>>
>> 1/4 slirp: Advance libslirp submodule to current master
>> NOTE TO REVIEWERS: It may be a better use of everyone's time if a
>> maintainer takes on advancing QEMU's libslirp to libslirp's master.
>> Beyond that, I really don't know what to do except submit this patch as
>> is currently provided.
>>
>> 2/4: util/qemu-sockets.c: Split host:port parsing out of inet_parse
>>
>> Also split out parsing of ipv4=on|off, ipv6=on|off
>>
>> 3/4: net/slirp.c: Refactor address parsing
>>
>> Use InetSocketAddress and getaddrinfo().
>> Use new libslirp calls: slirp_remove_hostxfwd, slirp_add_hostxfwd.
>>
>> 4/4: net: Extend host forwarding to support IPv6
>>
>> Recognize ipv4=,ipv6= options.
>>
>> Note: v5's 3/5 "Recognize []:port (empty ipv6 address)" has been deleted:
>> the churn on this patch series needs to be reduced.
>> This change is not required, and can easily be done in a later patch.
>>
>> Changes from v4:
>>
>> 1/5 slirp: Advance libslirp submodule to add ipv6 host-forward support
>> NOTE TO REVIEWERS: I need some hand-holding to know what The Right
>> way to submit this particular patch is.
>>
>> - no change
>>
>> 2/5 util/qemu-sockets.c: Split host:port parsing out of inet_parse
>>
>> - move recognition of "[]:port" to separate patch
>> - allow passing NULL for ip_v6
>> - fix some formatting issues
>>
>> 3/5 inet_parse_host_and_addr: Recognize []:port (empty ipv6 address)
>>
>> - new in this patchset revision
>>
>> 4/5 net/slirp.c: Refactor address parsing
>>
>> - was 3/4 in v4
>> - fix some formatting issues
>>
>> 5/5 net: Extend host forwarding to support IPv6
>>
>> - was 4/4 in v4
>> - fix some formatting issues
>>
>> Changes from v3:
>>
>> 1/4 slirp: Advance libslirp submodule to add ipv6 host-forward support
>>
>> - pick up latest libslirp patch to reject ipv6 addr-any for guest address
>>   - libslirp currently only provides a stateless DHCPv6 server, which
>> means
>>     it can't know in advance what the guest's IP address is, and thus
>>     cannot do the "addr-any -> guest ip address" translation that is done
>>     for ipv4
>>
>> 2/4 util/qemu-sockets.c: Split host:port parsing out of inet_parse
>>
>> - this patch is new in v4
>>   - provides new utility: inet_parse_host_and_port, updates inet_parse
>>     to use it
>>
>> 3/4 net/slirp.c: Refactor address parsing
>>
>> - this patch renamed from 2/3 to 3/4
>> - call inet_parse_host_and_port from util/qemu-sockets.c
>> - added tests/acceptance/hostfwd.py
>>
>> 4/4 net: Extend host forwarding to support IPv6
>>
>> - this patch renamed from 3/3 to 4/4
>> - ipv6 support added to existing hostfwd option, commands
>>   - instead of creating new ipv6 option, commands
>> - added tests to tests/acceptance/hostfwd.py
>>
>> Changes from v2:
>> - split out libslirp commit
>> - clarify spelling of ipv6 addresses in docs
>> - tighten parsing of ipv6 addresses
>>
>> Change from v1:
>> - libslirp part is now upstream
>> - net/slirp.c changes split into two pieces (refactor, add ipv6)
>> - added docs
>>
>> Doug Evans (4):
>>   slirp: Advance libslirp submodule to 4.5 release
>>   util/qemu-sockets.c: Split host:port parsing out of inet_parse
>>   net/slirp.c: Refactor address parsing
>>   net: Extend host forwarding to support IPv6
>>
>>  hmp-commands.hx             |  18 ++-
>>  include/qemu/sockets.h      |   5 +
>>  net/slirp.c                 | 272 ++++++++++++++++++++++++++++--------
>>  slirp                       |   2 +-
>>  tests/acceptance/hostfwd.py | 185 ++++++++++++++++++++++++
>>  util/qemu-sockets.c         |  82 +++++++----
>>  6 files changed, 473 insertions(+), 91 deletions(-)
>>  create mode 100644 tests/acceptance/hostfwd.py
>>
>> --
>> 2.32.0.rc0.204.g9fa02ecfa5-goog
>>
>>
max7255 June 15, 2021, 11:42 p.m. UTC | #3
Hi!

Looking good for me.

Thanks for finishing this!
The whole patchset also looks simpler now.

On 6/15/21 2:24 PM, Doug Evans wrote:
> Ping.
> 
> On Wed, Jun 9, 2021 at 9:41 PM Doug Evans <dje@google.com 
> <mailto:dje@google.com>> wrote:
> 
>     Ping.
> 
>     On Fri, May 28, 2021 at 4:53 PM Doug Evans <dje@google.com
>     <mailto:dje@google.com>> wrote:
> 
>         This patchset takes the original patch from Maxim,
>         https://www.mail-archive.com/qemu-devel@nongnu.org/msg569573.html
>         and updates it.
> 
>         Option hostfwd is extended to support ipv6 addresses.
>         Commands hostfwd_add, hostfwd_remove are extended as well.
> 
>         Changes from v6:
> 
>         1/4: Update to use libslirp v4.5.0 tag
> 
>         The libslirp parts of the patch have been committed to the
>         libslirp repo,
>         and are now in QEMU's copy of the libslirp repo.
>         Advancing QEMU to use Libslirp v4.5.0 is being done separately.
>         Discussion of patch 1/4 is left to that thread:
>         https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06010.html
> 
>         2/4: No change
> 
>         3/4: Add support for --enable-slirp=system
>         Tested with system libslirp 4.4.0.
> 
>         4/4: No change
> 
>         Changes from v5:
> 
>         1/4 slirp: Advance libslirp submodule to current master
>         NOTE TO REVIEWERS: It may be a better use of everyone's time if a
>         maintainer takes on advancing QEMU's libslirp to libslirp's master.
>         Beyond that, I really don't know what to do except submit this
>         patch as
>         is currently provided.
> 
>         2/4: util/qemu-sockets.c: Split host:port parsing out of inet_parse
> 
>         Also split out parsing of ipv4=on|off, ipv6=on|off
> 
>         3/4: net/slirp.c: Refactor address parsing
> 
>         Use InetSocketAddress and getaddrinfo().
>         Use new libslirp calls: slirp_remove_hostxfwd, slirp_add_hostxfwd.
> 
>         4/4: net: Extend host forwarding to support IPv6
> 
>         Recognize ipv4=,ipv6= options.
> 
>         Note: v5's 3/5 "Recognize []:port (empty ipv6 address)" has been
>         deleted:
>         the churn on this patch series needs to be reduced.
>         This change is not required, and can easily be done in a later
>         patch.
> 
>         Changes from v4:
> 
>         1/5 slirp: Advance libslirp submodule to add ipv6 host-forward
>         support
>         NOTE TO REVIEWERS: I need some hand-holding to know what The Right
>         way to submit this particular patch is.
> 
>         - no change
> 
>         2/5 util/qemu-sockets.c: Split host:port parsing out of inet_parse
> 
>         - move recognition of "[]:port" to separate patch
>         - allow passing NULL for ip_v6
>         - fix some formatting issues
> 
>         3/5 inet_parse_host_and_addr: Recognize []:port (empty ipv6 address)
> 
>         - new in this patchset revision
> 
>         4/5 net/slirp.c: Refactor address parsing
> 
>         - was 3/4 in v4
>         - fix some formatting issues
> 
>         5/5 net: Extend host forwarding to support IPv6
> 
>         - was 4/4 in v4
>         - fix some formatting issues
> 
>         Changes from v3:
> 
>         1/4 slirp: Advance libslirp submodule to add ipv6 host-forward
>         support
> 
>         - pick up latest libslirp patch to reject ipv6 addr-any for
>         guest address
>            - libslirp currently only provides a stateless DHCPv6 server,
>         which means
>              it can't know in advance what the guest's IP address is,
>         and thus
>              cannot do the "addr-any -> guest ip address" translation
>         that is done
>              for ipv4
> 
>         2/4 util/qemu-sockets.c: Split host:port parsing out of inet_parse
> 
>         - this patch is new in v4
>            - provides new utility: inet_parse_host_and_port, updates
>         inet_parse
>              to use it
> 
>         3/4 net/slirp.c: Refactor address parsing
> 
>         - this patch renamed from 2/3 to 3/4
>         - call inet_parse_host_and_port from util/qemu-sockets.c
>         - added tests/acceptance/hostfwd.py
> 
>         4/4 net: Extend host forwarding to support IPv6
> 
>         - this patch renamed from 3/3 to 4/4
>         - ipv6 support added to existing hostfwd option, commands
>            - instead of creating new ipv6 option, commands
>         - added tests to tests/acceptance/hostfwd.py
> 
>         Changes from v2:
>         - split out libslirp commit
>         - clarify spelling of ipv6 addresses in docs
>         - tighten parsing of ipv6 addresses
> 
>         Change from v1:
>         - libslirp part is now upstream
>         - net/slirp.c changes split into two pieces (refactor, add ipv6)
>         - added docs
> 
>         Doug Evans (4):
>            slirp: Advance libslirp submodule to 4.5 release
>            util/qemu-sockets.c: Split host:port parsing out of inet_parse
>            net/slirp.c: Refactor address parsing
>            net: Extend host forwarding to support IPv6
> 
>           hmp-commands.hx             |  18 ++-
>           include/qemu/sockets.h      |   5 +
>           net/slirp.c                 | 272
>         ++++++++++++++++++++++++++++--------
>           slirp                       |   2 +-
>           tests/acceptance/hostfwd.py | 185 ++++++++++++++++++++++++
>           util/qemu-sockets.c         |  82 +++++++----
>           6 files changed, 473 insertions(+), 91 deletions(-)
>           create mode 100644 tests/acceptance/hostfwd.py
> 
>         -- 
>         2.32.0.rc0.204.g9fa02ecfa5-goog
>