summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-11-07 15:32:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:53 -0500
commita8d741b4f7f83485178aedf7ca8068b3420ee93c (patch)
tree8d9d4e479b9a26cd2eccbf9f0fcb53b93d178180 /source4/torture
parent57b98a7436e555dbcb988fbe50c6dce35c7ef68f (diff)
downloadsamba-a8d741b4f7f83485178aedf7ca8068b3420ee93c.tar.gz
samba-a8d741b4f7f83485178aedf7ca8068b3420ee93c.tar.bz2
samba-a8d741b4f7f83485178aedf7ca8068b3420ee93c.zip
r11554: make us able to run without depending on 127.0.0.1
metze (This used to be commit 6bae17d279205a0d75f609f6a026b5c99d73cea5)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/local/socket.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/torture/local/socket.c b/source4/torture/local/socket.c
index ec0d3b1467..4a3a339333 100644
--- a/source4/torture/local/socket.c
+++ b/source4/torture/local/socket.c
@@ -57,12 +57,13 @@ static BOOL test_udp(TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
talloc_steal(mem_ctx, sock2);
- status = socket_listen(sock1, "127.0.0.1", 0, 0, 0);
+ status = socket_listen(sock1, iface_best_ip("127.0.0.1"), 0, 0, 0);
CHECK_STATUS(status, NT_STATUS_OK);
srv_addr = socket_get_my_addr(sock1, mem_ctx);
- if (srv_addr == NULL || strcmp(srv_addr, "127.0.0.1") != 0) {
- printf("Expected server address of 127.0.0.1 but got %s\n", srv_addr);
+ if (srv_addr == NULL || strcmp(srv_addr, iface_best_ip("127.0.0.1")) != 0) {
+ printf("Expected server address of %s but got %s\n",
+ iface_best_ip("127.0.0.1"), srv_addr);
return False;
}
@@ -152,12 +153,13 @@ static BOOL test_tcp(TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
talloc_steal(mem_ctx, sock2);
- status = socket_listen(sock1, "127.0.0.1", 0, 0, 0);
+ status = socket_listen(sock1, iface_best_ip("127.0.0.1"), 0, 0, 0);
CHECK_STATUS(status, NT_STATUS_OK);
srv_addr = socket_get_my_addr(sock1, mem_ctx);
- if (srv_addr == NULL || strcmp(srv_addr, "127.0.0.1") != 0) {
- printf("Expected server address of 127.0.0.1 but got %s\n", srv_addr);
+ if (srv_addr == NULL || strcmp(srv_addr, iface_best_ip("127.0.0.1")) != 0) {
+ printf("Expected server address of %s but got %s\n",
+ iface_best_ip("127.0.0.1"), srv_addr);
return False;
}