mbox series

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

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

Message

Doug Evans Feb. 18, 2021, 8:15 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.

The libslirp part of the patch has been committed upstream,
and is now in qemu. See patch 1/4.

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 add ipv6 host-forward support
  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             |  15 +++
 include/qemu/sockets.h      |   3 +
 net/slirp.c                 | 194 ++++++++++++++++++++++++------------
 slirp                       |   2 +-
 tests/acceptance/hostfwd.py | 150 ++++++++++++++++++++++++++++
 util/qemu-sockets.c         |  94 ++++++++++++-----
 6 files changed, 370 insertions(+), 88 deletions(-)
 create mode 100644 tests/acceptance/hostfwd.py

Comments

no-reply@patchew.org Feb. 18, 2021, 8:34 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210218201538.701509-1-dje@google.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210218201538.701509-1-dje@google.com
Subject: [PATCH v4 0/4] Add support for ipv6 host forwarding

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210218201538.701509-1-dje@google.com -> patchew/20210218201538.701509-1-dje@google.com
Switched to a new branch 'test'
2998bb9b net: Extend host forwarding to support IPv6
2b46856 net/slirp.c: Refactor address parsing
61d8583 util/qemu-sockets.c: Split host:port parsing out of inet_parse
ad280b5 slirp: Advance libslirp submodule to add ipv6 host-forward support

=== OUTPUT BEGIN ===
1/4 Checking commit ad280b59a66e (slirp: Advance libslirp submodule to add ipv6 host-forward support)
2/4 Checking commit 61d85833d837 (util/qemu-sockets.c: Split host:port parsing out of inet_parse)
ERROR: "foo* bar" should be "foo *bar"
#25: FILE: include/qemu/sockets.h:34:
+const char* inet_parse_host_and_port(const char* str, int terminator,

ERROR: "foo* bar" should be "foo *bar"
#50: FILE: util/qemu-sockets.c:629:
+const char* inet_parse_host_and_port(const char* str, int terminator,

total: 2 errors, 0 warnings, 123 lines checked

Patch 2/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/4 Checking commit 2b46856db1e0 (net/slirp.c: Refactor address parsing)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#247: 
new file mode 100644

WARNING: line over 80 characters
#302: FILE: tests/acceptance/hostfwd.py:51:
+                          "Could not set up host forwarding rule 'udp::65042-:42'\r\n")

ERROR: line over 90 characters
#319: FILE: tests/acceptance/hostfwd.py:68:
+                          "Invalid host forwarding rule 'abc::65022-:22' (Bad protocol name)\r\n")

ERROR: line over 90 characters
#321: FILE: tests/acceptance/hostfwd.py:70:
+                          "Invalid host forwarding rule ':a.b.c.d:66-:66' (For host address: Bad address)\r\n")

ERROR: line over 90 characters
#323: FILE: tests/acceptance/hostfwd.py:72:
+                          "Invalid host forwarding rule '::66-a.b.c.d:66' (For guest address: Bad address)\r\n")

ERROR: line over 90 characters
#325: FILE: tests/acceptance/hostfwd.py:74:
+                          "Invalid host forwarding rule '::66666-:66666' (For host address: Bad port)\r\n")

ERROR: line over 90 characters
#327: FILE: tests/acceptance/hostfwd.py:76:
+                          "Invalid host forwarding rule '::-1-foo' (For host address: error parsing host:port ':')\r\n")

ERROR: line over 90 characters
#329: FILE: tests/acceptance/hostfwd.py:78:
+                          "Invalid host forwarding rule '::66-foo' (For guest address: error parsing host:port 'foo')\r\n")

ERROR: line over 90 characters
#331: FILE: tests/acceptance/hostfwd.py:80:
+                          "Invalid host forwarding rule '::66-:66666' (For guest address: Bad port)\r\n")

ERROR: line over 90 characters
#333: FILE: tests/acceptance/hostfwd.py:82:
+                          "Invalid host forwarding rule '::66-:-1' (For guest address: Bad port)\r\n")

ERROR: line over 90 characters
#335: FILE: tests/acceptance/hostfwd.py:84:
+                          "Invalid host forwarding rule '::66-:0' (For guest address: Bad port)\r\n")

total: 9 errors, 2 warnings, 304 lines checked

Patch 3/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

4/4 Checking commit 2998bb9bc67e (net: Extend host forwarding to support IPv6)
WARNING: line over 80 characters
#224: FILE: tests/acceptance/hostfwd.py:91:
+        self.assertEquals(self.hmc('hostfwd_add vnet tcp:[::1]:65022-[fe80::1]:22'),

WARNING: line over 80 characters
#227: FILE: tests/acceptance/hostfwd.py:94:
+                          'host forwarding rule for tcp:[::1]:65022 removed\r\n')

WARNING: line over 80 characters
#235: FILE: tests/acceptance/hostfwd.py:102:
+                          'host forwarding rule for udp:[::1]:65042 removed\r\n')

ERROR: line over 90 characters
#248: FILE: tests/acceptance/hostfwd.py:115:
+                          "Could not set up host forwarding rule 'udp:[::1]:65042-[fe80::1]:42'\r\n")

WARNING: line over 80 characters
#252: FILE: tests/acceptance/hostfwd.py:119:
+                          'host forwarding rule for udp:[::1]:65042 removed\r\n')

WARNING: line over 80 characters
#254: FILE: tests/acceptance/hostfwd.py:121:
+                          'host forwarding rule for udp:[::1]:65042 not found\r\n')

ERROR: line over 90 characters
#263: FILE: tests/acceptance/hostfwd.py:130:
+                          "Invalid host forwarding rule ':[::1-' (For host address: error parsing IPv6 host:port '[::1')\r\n")

ERROR: line over 90 characters
#265: FILE: tests/acceptance/hostfwd.py:132:
+                          "Invalid host forwarding rule ':[::1]:66-[fe80::1' (For guest address: error parsing IPv6 host:port '[fe80::1')\r\n")

ERROR: line over 90 characters
#267: FILE: tests/acceptance/hostfwd.py:134:
+                          "Invalid host forwarding rule ':[:::]:66-foo' (For host address: Bad address)\r\n")

ERROR: line over 90 characters
#269: FILE: tests/acceptance/hostfwd.py:136:
+                          "Invalid host forwarding rule ':[::1]-foo' (For host address: error parsing IPv6 host:port '[::1]')\r\n")

ERROR: line over 90 characters
#271: FILE: tests/acceptance/hostfwd.py:138:
+                          "Invalid host forwarding rule ':[::1]:66-[foo]' (For guest address: error parsing IPv6 host:port '[foo]')\r\n")

ERROR: line over 90 characters
#273: FILE: tests/acceptance/hostfwd.py:140:
+                          "Invalid host forwarding rule ':[::1]:66666-foo' (For host address: Bad port)\r\n")

ERROR: line over 90 characters
#275: FILE: tests/acceptance/hostfwd.py:142:
+                          "Invalid host forwarding rule ':[::1]:66-[fe80::1]:-1' (For guest address: Bad port)\r\n")

ERROR: line over 90 characters
#277: FILE: tests/acceptance/hostfwd.py:144:
+                          "Invalid host forwarding rule ':[::1]:66-[fe80::1]:66666' (For guest address: Bad port)\r\n")

ERROR: line over 90 characters
#279: FILE: tests/acceptance/hostfwd.py:146:
+                          "Invalid host forwarding rule ':[::1]:66-[fe80::1]:0' (For guest address: Bad port)\r\n")

ERROR: line over 90 characters
#281: FILE: tests/acceptance/hostfwd.py:148:
+                          "Invalid host forwarding rule ':[::1]:66-1.2.3.4:66' (Both host,guest must be one of ipv4 or ipv6)\r\n")

ERROR: line over 90 characters
#283: FILE: tests/acceptance/hostfwd.py:150:
+                          "Invalid host forwarding rule ':1.2.3.4:66-[fe80::1]:66' (Both host,guest must be one of ipv4 or ipv6)\r\n")

total: 12 errors, 5 warnings, 245 lines checked

Patch 4/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210218201538.701509-1-dje@google.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com