summaryrefslogtreecommitdiff
path: root/tests/test-io-channel-socket.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2015-12-22 15:43:42 +0000
committerDaniel P. Berrange <berrange@redhat.com>2015-12-22 18:19:08 +0000
commite4d2edc9d0c58de421eb349871e90b67edec0b9c (patch)
treef61c159db8621d87874f07e71c184fff3f483632 /tests/test-io-channel-socket.c
parent5dc42c186d63b7b338594fc071cf290805dcc5a5 (diff)
downloadqemu-e4d2edc9d0c58de421eb349871e90b67edec0b9c.tar.gz
io: bind to loopback IP addrs in test suite
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> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests/test-io-channel-socket.c')
-rw-r--r--tests/test-io-channel-socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index 194d043878..e76d54c3f8 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;