qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] io: bind to loopback IP addrs in test suite
@ 2015-12-22 15:46 Daniel P. Berrange
  2015-12-22 16:33 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2015-12-22 15:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

The test suite currently binds to 0.0.0.0 or ::, which covers
all interfaces of the machine. It is bad practice for test
suite to open publically accessible ports on a machine, so
switch to use loopback addrs 127.0.0.1 or ::1.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 tests/test-io-channel-socket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index 194d043..e76d54c 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -261,7 +261,7 @@ static void test_io_channel_ipv4(bool async)
 
     listen_addr->type = SOCKET_ADDRESS_KIND_INET;
     listen_addr->u.inet = g_new0(InetSocketAddress, 1);
-    listen_addr->u.inet->host = g_strdup("0.0.0.0");
+    listen_addr->u.inet->host = g_strdup("127.0.0.1");
     listen_addr->u.inet->port = NULL; /* Auto-select */
 
     connect_addr->type = SOCKET_ADDRESS_KIND_INET;
@@ -295,7 +295,7 @@ static void test_io_channel_ipv6(bool async)
 
     listen_addr->type = SOCKET_ADDRESS_KIND_INET;
     listen_addr->u.inet = g_new0(InetSocketAddress, 1);
-    listen_addr->u.inet->host = g_strdup("::");
+    listen_addr->u.inet->host = g_strdup("::1");
     listen_addr->u.inet->port = NULL; /* Auto-select */
 
     connect_addr->type = SOCKET_ADDRESS_KIND_INET;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] io: bind to loopback IP addrs in test suite
  2015-12-22 15:46 [Qemu-devel] [PATCH] io: bind to loopback IP addrs in test suite Daniel P. Berrange
@ 2015-12-22 16:33 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2015-12-22 16:33 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

On 12/22/2015 08:46 AM, Daniel P. Berrange wrote:
> The test suite currently binds to 0.0.0.0 or ::, which covers
> all interfaces of the machine. It is bad practice for test
> suite to open publically accessible ports on a machine, so
> switch to use loopback addrs 127.0.0.1 or ::1.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  tests/test-io-channel-socket.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-22 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-22 15:46 [Qemu-devel] [PATCH] io: bind to loopback IP addrs in test suite Daniel P. Berrange
2015-12-22 16:33 ` Eric Blake

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).