summaryrefslogtreecommitdiff
path: root/source4/torture/nbt
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-16 01:48:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:43 -0500
commit4c7c38e930805b84789cfb2472776d6939fc23f6 (patch)
tree4f7174c83760be60d1b65cd654a624b7b1b19c7c /source4/torture/nbt
parente284054f655a430769fb02e4927256495338ff66 (diff)
downloadsamba-4c7c38e930805b84789cfb2472776d6939fc23f6.tar.gz
samba-4c7c38e930805b84789cfb2472776d6939fc23f6.tar.bz2
samba-4c7c38e930805b84789cfb2472776d6939fc23f6.zip
r5411: make network interface selection a bit saner
- if we have no configured network interfaces, then don't start nbtd (when I add dynamic interface loading this will change to a delay until a network interface comes up) - choose the best interface by netmask for torture tests that need a specific IP (such as the WINS test). Added iface_best_ip() for that. - if specific interfaces are chosen in smb.conf, then keep that ordering, and default to the first one listed (This used to be commit 4d08c114079ef6d1d10a96195046fe43631aefa2)
Diffstat (limited to 'source4/torture/nbt')
-rw-r--r--source4/torture/nbt/register.c4
-rw-r--r--source4/torture/nbt/wins.c2
-rw-r--r--source4/torture/nbt/winsbench.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c
index 40b8a587fe..e9b98663a5 100644
--- a/source4/torture/nbt/register.c
+++ b/source4/torture/nbt/register.c
@@ -49,7 +49,7 @@ static BOOL nbt_register_own(TALLOC_CTX *mem_ctx, struct nbt_name *name,
NTSTATUS status;
struct nbt_name_socket *nbtsock = nbt_name_socket_init(mem_ctx, NULL);
BOOL ret = True;
- const char *myaddress = iface_n_ip(0);
+ const char *myaddress = iface_best_ip(address);
socket_listen(nbtsock->sock, myaddress, 0, 0, 0);
@@ -114,7 +114,7 @@ static BOOL nbt_refresh_own(TALLOC_CTX *mem_ctx, struct nbt_name *name,
NTSTATUS status;
struct nbt_name_socket *nbtsock = nbt_name_socket_init(mem_ctx, NULL);
BOOL ret = True;
- const char *myaddress = iface_n_ip(0);
+ const char *myaddress = iface_best_ip(address);
socket_listen(nbtsock->sock, myaddress, 0, 0, 0);
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index 3f8b361a93..f92a23f732 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -60,7 +60,7 @@ static BOOL nbt_test_wins_name(TALLOC_CTX *mem_ctx, const char *address,
NTSTATUS status;
struct nbt_name_socket *nbtsock = nbt_name_socket_init(mem_ctx, NULL);
BOOL ret = True;
- const char *myaddress = talloc_strdup(mem_ctx, iface_n_ip(0));
+ const char *myaddress = talloc_strdup(mem_ctx, iface_best_ip(address));
/* we do the listen here to ensure the WINS server receives the packets from
the right IP */
diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c
index f6a6283dd2..54f730ce84 100644
--- a/source4/torture/nbt/winsbench.c
+++ b/source4/torture/nbt/winsbench.c
@@ -231,7 +231,7 @@ static BOOL bench_wins(TALLOC_CTX *mem_ctx, struct nbt_name *name, const char *a
state->num_names = torture_entries;
state->registered = talloc_zero_array(state, BOOL, state->num_names);
state->wins_server = address;
- state->my_ip = talloc_strdup(mem_ctx, iface_n_ip(0));
+ state->my_ip = talloc_strdup(mem_ctx, iface_best_ip(address));
state->ttl = timelimit;
socket_listen(nbtsock->sock, state->my_ip, 0, 0, 0);