util/qemu-sockets.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Wrapping an IP address in square brackets does not necessarily
mean the address is an IPv6 address. The wrapping is just an aid
to parsing since IPv6 addresses have colons, but does not provide
semantic information.
E.g., [127.0.0.1] is a valid way to write 127.0.0.1.
Signed-off-by: Doug Evans <dje@google.com>
---
util/qemu-sockets.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 8af0278f15..0c41d372c0 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -635,9 +635,12 @@ int inet_parse(InetSocketAddress *addr, const char *str, Error **errp)
return -1;
}
} else if (str[0] == '[') {
- /* IPv6 addr */
+ /*
+ * Probably, but not necessarily, an IPv6 addr.
+ * Note that [127.0.0.1] is also valid.
+ */
if (sscanf(str, "[%64[^]]]:%32[^,]%n", host, port, &pos) != 2) {
- error_setg(errp, "error parsing IPv6 address '%s'", str);
+ error_setg(errp, "error parsing address '%s'", str);
return -1;
}
} else {
--
2.30.1.766.gb4fecdf3b7-goog
Patchew URL: https://patchew.org/QEMU/20210308002928.3385275-1-dje@google.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210308002928.3385275-1-dje@google.com Subject: [PATCH] inet_parse: Clarify IPv6 comment and error message === 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/20210308002928.3385275-1-dje@google.com -> patchew/20210308002928.3385275-1-dje@google.com Switched to a new branch 'test' 6e42a49 inet_parse: Clarify IPv6 comment and error message === OUTPUT BEGIN === ERROR: Author email address is mangled by the mailing list #2: Author: Doug Evans via <qemu-devel@nongnu.org> total: 1 errors, 0 warnings, 14 lines checked Commit 6e42a4981895 (inet_parse: Clarify IPv6 comment and error message) 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/20210308002928.3385275-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
Not sure how this "Author email address is mangled" happened. $ git format-patch -o patches/error-parsing-ipv6 -1 $ git send-email --to='qemu-devel@nongnu.org,Samuel Thibault < samuel.thibault@ens-lyon.org>,"Daniel P. Berrangé" <berrange@redhat.com>' \ --smtp-server=foo patches/error-parsing-ipv6/0001-inet_parse-Clarify-IPv6-comment-and-error-message.patch It's possible my smtp-server arg munged things incorrectly, but I've done the identical thing for previous patches and not seen this for at least some of them. Sigh. On Sun, Mar 7, 2021 at 4:33 PM <no-reply@patchew.org> wrote: > Patchew URL: > https://patchew.org/QEMU/20210308002928.3385275-1-dje@google.com/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series > Message-id: 20210308002928.3385275-1-dje@google.com > Subject: [PATCH] inet_parse: Clarify IPv6 comment and error message > > === 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/20210308002928.3385275-1-dje@google.com -> > patchew/20210308002928.3385275-1-dje@google.com > Switched to a new branch 'test' > 6e42a49 inet_parse: Clarify IPv6 comment and error message > > === OUTPUT BEGIN === > ERROR: Author email address is mangled by the mailing list > #2: > Author: Doug Evans via <qemu-devel@nongnu.org> > > total: 1 errors, 0 warnings, 14 lines checked > > Commit 6e42a4981895 (inet_parse: Clarify IPv6 comment and error message) > 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/20210308002928.3385275-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
© 2016 - 2024 Red Hat, Inc.