Add support for ipv6 host forwarding
v7 cover Add support for ipv6 host forwarding
This patchset takes the original patch from Maxim,
https://www.mail-archive.com/[email protected]/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
Signature · 1 line
2.32.0.rc0.204.g9fa02ecfa5-goog
PATCH v7 1/4 slirp: Advance libslirp submodule to 4.5 release
5eraph (2):
disable_dns option
limit vnameserver_addr to port 53
Akihiro Suda (1):
libslirp.h: fix SlirpConfig v3 documentation
Doug Evans (11):
Add ipv6 host forward support
tcpx_listen: Pass sizeof(addr) to memset Reject host forwarding to ipv6 "addr-any" Add /build/ to .gitignore
New utility slirp_ether_ntoa
m_cleanup_list: make static
New API routine slirp_neighbor_info
Move DEBUG_CALL("if_start") to DEBUG_VERBOSE_CALL
tcpx_listen: tcp_newtcpcb doesn't fail slirp_add_host*fwd: Ensure all error paths set errno Perform lazy guest address resolution for IPv6
Dr. David Alan Gilbert (1):
ip_stripoptions use memmove
Giuseppe Scrivano (1):
socket: consume empty packets
Hafiz Abid Qadeer (1):
Fix a typo that can cause slow socket response on Windows.
Jindrich Novy (4):
Fix possible infinite loops and use-after-free Use secure string copy to avoid overflow Be sure to initialize sockaddr structure Check lseek() for failure
Marc-André Lureau (28):
Merge branch 'master' into 'master'
Merge branch 'fix-slirpconfig-3-doc' into 'master' Fix use-afte-free in ip_reass() (CVE-2020-1983) Update CHANGELOG
Merge branch 'cve-2020-1983' into 'master' Release v4.3.0
Merge branch 'release-v4.3.0' into 'master'
changelog: post-release
util: do not silently truncate
Merge branch 'slirp-fmt-truncate' into 'master' Release v4.3.1
Merge branch 'release-v4.3.1' into 'master'
changelog: post-release
.gitlab-ci: add a Coverity stage
Merge branch 'coverity' into 'master'
Merge branch 'ios-support' into 'master' Merge branch 'master' into 'master'
Remove the QEMU-special make build-system Merge branch 'qemu' into 'master'
Release v4.4.0
Merge branch '4.4.0-release' into 'master'
changelog: post-release
Remove some needless (void)casts
Fix unused variables
Merge branch 'gitignore-build' into 'master' Merge branch 'macos-deployment-target' into 'master' Merge branch 'philmd' into 'master'
Release v4.5.0
Nathaniel Wesley Filardo (1):
fork_exec_child_setup: improve signal handling
Paolo Bonzini (2):
meson: remove meson-dist script
meson: support compiling as subproject
Philippe Mathieu-Daudé (4):
Fix win32 builds by using the SLIRP_PACKED definition Fix constness warnings
Remove unnecessary break
Remove alloca() call in get_dns_addr_resolv_conf()
Prasad J Pandit (1):
slirp: check pkt_len before reading protocol header
Ralf Haferkamp (2):
Drop bogus IPv6 messages
Fix MTU check
Samuel Thibault (48):
Merge branch 'ip6_payload_len' into 'master'
Merge branch 'lp1878043' into 'master'
udp, udp6, icmp: handle TTL value
icmp, icmp6: Add icmp_forward_error and icmp6_forward_error udp, udp6, icmp, icmp6: Enable forwarding errors on Linux
TCPIPHDR_DELTA: Fix potential negative value
sosendoob: better document what urgc is used for
Merge branch 'G_GNUC_PRINTF' into 'master'
Merge branch 'CVE-2020-29129' into 'master'
Merge branch 'ttl' into 'master'
Merge branch 'errors' into 'master'
Merge branch 'consume-empty-packet' into 'master'
Merge branch 'void' into 'master'
Merge branch 'master' into 'master'
Merge branch 'unused' into 'master'
Merge branch 'socket_delay' into 'master'
tcp_subr: simplify code
Merge branch 'ipv6-host-fwd-9-patch' into 'master' Document the slirp API
Complete timeout documentation
Merge branch 'memset-sizeof' into 'master'
Merge branch 'reject-ipv6-addr-any' into 'master'
ip6_output: fix memory leak on fast-send
Merge branch 'ndp-leak' into 'master'
Merge branch 'memory_leaks' into 'master'
TODO for generalizing the hostfwd calls
socket.h: add missing sbuf.h inclusion
Expose udpx_listen and tcpx_listen as taking sockaddr Disable polling for PRI on MacOS
Merge branch 'macos-pri' into 'master'
Merge branch 'x_listen' into 'master'
udpx/tcpx_listen: Add missing const qualifier
sockaddr_*: add missing const qualifiers
Merge branch 'm-cleanup-list-prototype' into 'master' Merge branch 'neighbor-info' into 'master' udpx/tcpx_listen: Use struct sockaddr * types
Add ipv4/ipv6-agnostic host forwarding functions
hostfwd: Add SLIRP_HOSTFWD_V6ONLY flag
Merge branch 'hostxfwd' into 'master'
Merge branch 'verbose-if-start' into 'master'
Remove slirp_add/remove_ipv6_hostfwd
Merge branch 'listen-errno' into 'master'
Merge branch 'newtcpcb-no-fail' into 'master'
Merge branch 'listen_v6only' into 'master'
Merge branch 'lazy-ipv6-resolution' into 'master'
ndp_table: For unspecified address, return broadcast ethernet address Merge branch 'master' into 'master'
SlirpCb: explicit that it is fine for a guest to drop frames
Stefan Weil (1):
Add G_GNUC_PRINTF to local function slirp_vsnprintf
WaluigiWare64 (1):
Set macOS deployment target to macOS 10.4 Without a macOS deployment target, the resulting library does not work on macOS versions lower than it was currently built on. For example, if libslirp was built on macOS 10.15, it would not work on macOS 10.14.
jeremy marchand (4):
m_free: remove the M_EXT flag after freeing the mbuf extended buffer refactor m_cleanup as requested in slirp/libslirp!68
m_cleanup: fix memory leaks
m_cleanup: set qh_link and qh_rlink to the list head
osy (1):
Add DNS resolving for iOS
---
Changes from v6:
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
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.
slirp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
slirp +1 -1
@@ -1 +1 @@ -Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece +Subproject commit a62890e71126795ca593affa747f669bed88e89c
Signature · 1 line
2.32.0.rc0.204.g9fa02ecfa5-goog
PATCH v7 2/4 util/qemu-sockets.c: Split host:port parsing out of inet_parse
In reply to Doug EvansThe parsing is moved into new function inet_parse_host_port. Also split out is ipv4=flag, ipv6=flag processing into inet_parse_ipv46. This is done in preparation for using these functions in net/slirp.c.
---
Changes from v6:
No changes.
Changes from v5:
Also split out parsing of ipv4=on|off, ipv6=on|off
include/qemu/sockets.h | 3 ++ util/qemu-sockets.c | 65 +++++++++++++++++++++++++++++------------- 2 files changed, 48 insertions(+), 20 deletions(-)
include/qemu/sockets.h +3 -0
@@ -31,6 +31,9 @@ int socket_set_fast_reuse(int fd);int inet_ai_family_from_address (InetSocketAddress *addr,Error **errp); +const char *inet_parse_host_port (InetSocketAddress *addr, +const char *str,Error **errp); +int inet_parse_ipv46 (InetSocketAddress *addr,const char *optstr,Error **errp);int inet_parse (InetSocketAddress *addr,const char *str,Error **errp);int inet_connect (const char *str,Error **errp);int inet_connect_saddr (InetSocketAddress *saddr,Error **errp);
util/qemu-sockets.c +45 -20
103 lines not on this page · raw message
Signature · 1 line
2.32.0.rc0.204.g9fa02ecfa5-goog
PATCH v7 3/4 net/slirp.c: Refactor address parsing
In reply to Doug Evans... in preparation for adding ipv6 host forwarding support.
Tested:
avocado run tests/acceptance/hostfwd.py
---
Changes from v6:
Add support for --enable-slirp=system
Tested with system libslirp 4.4.0.
Changes from v5:
Use InetSocketAddress and getaddrinfo().
Use new libslirp calls: slirp_remove_hostxfwd, slirp_add_hostxfwd.
include/qemu/sockets.h | 2 + net/slirp.c | 236 ++++++++++++++++++++++++++---------- tests/acceptance/hostfwd.py | 91 ++++++++++++++ util/qemu-sockets.c | 17 ++- 4 files changed, 278 insertions(+), 68 deletions(-) create mode 100644 tests/acceptance/hostfwd.py
include/qemu/sockets.h +2 -0
@@ -29,6 +29,8 @@ int socket_set_fast_reuse(int fd);#define SHUT_RDWR 2#endif +int sockaddr_getport (const struct sockaddr *addr); +int inet_ai_family_from_address (InetSocketAddress *addr,Error **errp); const char *inet_parse_host_port(InetSocketAddress *addr,
net/slirp.c +174 -62
298 lines not on this page · raw message
tests/acceptance/hostfwd.py new file +91 -0
91 lines not on this page · raw message
util/qemu-sockets.c +11 -6
@@ -46,23 +46,28 @@#endif -static int inet_getport (struct addrinfo *e) +int sockaddr_getport (const struct sockaddr *addr) { -struct sockaddr_in *i4; -struct sockaddr_in6 *i6; +const struct sockaddr_in *i4; +const struct sockaddr_in6 *i6; -switch (e->ai_family) { +switch (addr->sa_family) {case PF_INET6 : - i6 = (void *)e->ai_addr; + i6 = (void *)addr;return ntohs (i6->sin6_port);case PF_INET : - i4 = (void *)e->ai_addr; + i4 = (void *)addr;return ntohs (i4->sin_port);default :return 0 ; } } +static int inet_getport (struct addrinfo *e) +{ +return sockaddr_getport (e->ai_addr); +} +static void inet_setport (struct addrinfo *e,int port) {struct sockaddr_in *i4;
Signature · 1 line
2.32.0.rc0.204.g9fa02ecfa5-goog
PATCH v7 4/4 net: Extend host forwarding to support IPv6
In reply to Doug EvansNet option "-hostfwd" now supports IPv6 addresses. Commands hostfwd_add, hostfwd_remove now support IPv6 addresses.
Tested:
avocado run tests/acceptance/hostfwd.py
---
Changes from v6:
No changes.
Changes from v5:
Recognize ipv4=,ipv6= options.
hmp-commands.hx | 18 ++++++- net/slirp.c | 54 +++++++++++++++++---- tests/acceptance/hostfwd.py | 94 +++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+), 11 deletions(-)
hmp-commands.hx +16 -2
@@ -1322,7 +1322,8 @@ ERST { .name = "hostfwd_add", .args_type = "arg1:s,arg2:s?", - .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport\n" + "[,ipv4=on|off][,ipv6=on|off]-[guestaddr]:guestport", .help = "redirect TCP or UDP connections from host to guest (requires -net user)", .cmd = hmp_hostfwd_add, },
@@ -1330,13 +1331,20 @@ ERST SRST ``hostfwd_add`` Redirect TCP or UDP connections from host to guest (requires -net user). + IPV6 addresses are wrapped in square brackets, IPV4 addresses are not. + + Examples: + hostfwd_add net0 tcp:127.0.0.1:10022-:22 + hostfwd_add net0 tcp:[::1]:10022-[fe80::1:2:3:4]:22 + hostfwd_add net0 ::10022,ipv6-:22 ERST #ifdef CONFIG_SLIRP { .name = "hostfwd_remove", .args_type = "arg1:s,arg2:s?", - .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport", + .params = "[netdev_id] [tcp|udp]:[hostaddr]:hostport\n" + "[,ipv4=on|off][,ipv6=on|off]", .help = "remove host-to-guest TCP or UDP redirection", .cmd = hmp_hostfwd_remove, },
@@ -1345,6 +1353,12 @@ ERST SRST ``hostfwd_remove`` Remove host-to-guest TCP or UDP redirection. + IPV6 addresses are wrapped in square brackets, IPV4 addresses are not. + + Examples: + hostfwd_remove net0 tcp:127.0.0.1:10022 + hostfwd_remove net0 tcp:[::1]:10022 + hostfwd_remove net0 ::10022,ipv6 ERST {
net/slirp.c +45 -9
104 lines not on this page · raw message
tests/acceptance/hostfwd.py +94 -0
103 lines not on this page · raw message
Signature · 1 line
2.32.0.rc0.204.g9fa02ecfa5-goog
Ping.
Quoted 135 lines · Doug Evans
This patchset takes the original patch from Maxim,
https://www.mail-archive.com/[email protected]/msg569573.html
and updates it.Option hostfwd is extended to support ipv6 addresses. Commands
hostfwd_add,hostfwd_removeare 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.html2/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 ofinet_parseAlso split out parsing of ipv4=on|off, ipv6=on|off
3/4:
net/slirp.c: Refactor address parsingUse 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 ofinet_parse- move recognition of "[]:port" to separate patch
- allow passing NULL forip_v6
- fix some formatting issues3/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 issues5/5 net: Extend host forwarding to support IPv6
- was 4/4 in v4
- fix some formatting issuesChanges 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 ipv42/4
util/qemu-sockets.c: Split host:port parsing out ofinet_parse- this patch is new in v4
- provides new utility:inet_parse_host_and_port, updatesinet_parseto use it3/4
net/slirp.c: Refactor address parsing- this patch renamed from 2/3 to 3/4
- callinet_parse_host_and_portfromutil/qemu-sockets.c
- addedtests/acceptance/hostfwd.py4/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 totests/acceptance/hostfwd.pyChanges from v2:
- split out libslirp commit
- clarify spelling of ipv6 addresses in docs
- tighten parsing of ipv6 addressesChange from v1:
- libslirp part is now upstream
-net/slirp.cchanges split into two pieces (refactor, add ipv6)
- added docsDoug Evans (4):
slirp: Advance libslirp submodule to 4.5 releaseutil/qemu-sockets.c: Split host:port parsing out ofinet_parsenet/slirp.c: Refactor address parsing
net: Extend host forwarding to support IPv6hmp-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
Ping.
Quoted 140 lines · Doug Evans
Ping.
Quoted 136 lines · Doug Evans
This patchset takes the original patch from Maxim,
https://www.mail-archive.com/[email protected]/msg569573.html
and updates it.Option hostfwd is extended to support ipv6 addresses. Commands
hostfwd_add,hostfwd_removeare 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.html2/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 ofinet_parseAlso split out parsing of ipv4=on|off, ipv6=on|off
3/4:
net/slirp.c: Refactor address parsingUse 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 ofinet_parse- move recognition of "[]:port" to separate patch
- allow passing NULL forip_v6
- fix some formatting issues3/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 issues5/5 net: Extend host forwarding to support IPv6
- was 4/4 in v4
- fix some formatting issuesChanges 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 ipv42/4
util/qemu-sockets.c: Split host:port parsing out ofinet_parse- this patch is new in v4
- provides new utility:inet_parse_host_and_port, updatesinet_parseto use it3/4
net/slirp.c: Refactor address parsing- this patch renamed from 2/3 to 3/4
- callinet_parse_host_and_portfromutil/qemu-sockets.c
- addedtests/acceptance/hostfwd.py4/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 totests/acceptance/hostfwd.pyChanges from v2:
- split out libslirp commit
- clarify spelling of ipv6 addresses in docs
- tighten parsing of ipv6 addressesChange from v1:
- libslirp part is now upstream
-net/slirp.cchanges split into two pieces (refactor, add ipv6)
- added docsDoug Evans (4):
slirp: Advance libslirp submodule to 4.5 releaseutil/qemu-sockets.c: Split host:port parsing out ofinet_parsenet/slirp.c: Refactor address parsing
net: Extend host forwarding to support IPv6hmp-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
Hi!
Looking good for me.
Thanks for finishing this!
The whole patchset also looks simpler now.
Quoted 155 lines · Doug Evans
Ping.
On Wed, Jun 9, 2021 at 9:41 PM Doug Evans <[email protected] <mailto:[email protected]>> wrote:
Ping.
On Fri, May 28, 2021 at 4:53 PM Doug Evans <[email protected] <mailto:[email protected]>> wrote:
This patchset takes the original patch from Maxim,
https://www.mail-archive.com/[email protected]/msg569573.html
and updates it.Option hostfwd is extended to support ipv6 addresses. Commands
hostfwd_add,hostfwd_removeare 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.html2/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 ofinet_parseAlso split out parsing of ipv4=on|off, ipv6=on|off
3/4:
net/slirp.c: Refactor address parsingUse 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 ofinet_parse- move recognition of "[]:port" to separate patch
- allow passing NULL forip_v6
- fix some formatting issues3/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 issues5/5 net: Extend host forwarding to support IPv6
- was 4/4 in v4
- fix some formatting issuesChanges 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 ipv42/4
util/qemu-sockets.c: Split host:port parsing out ofinet_parse- this patch is new in v4
- provides new utility:inet_parse_host_and_port, updates
inet_parse
to use it3/4
net/slirp.c: Refactor address parsing- this patch renamed from 2/3 to 3/4
- callinet_parse_host_and_portfromutil/qemu-sockets.c
- addedtests/acceptance/hostfwd.py4/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 totests/acceptance/hostfwd.pyChanges from v2:
- split out libslirp commit
- clarify spelling of ipv6 addresses in docs
- tighten parsing of ipv6 addressesChange from v1:
- libslirp part is now upstream
-net/slirp.cchanges split into two pieces (refactor, add ipv6)
- added docsDoug Evans (4):
slirp: Advance libslirp submodule to 4.5 releaseutil/qemu-sockets.c: Split host:port parsing out ofinet_parsenet/slirp.c: Refactor address parsing
net: Extend host forwarding to support IPv6hmp-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 100644tests/acceptance/hostfwd.py--
2.32.0.rc0.204.g9fa02ecfa5-goog