summaryrefslogtreecommitdiff
path: root/source4/torture/nbt
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@sernet.de>2008-01-11 19:01:50 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-19 07:05:22 +0100
commit384b9f709a16085e48469484a564ce0a7128af13 (patch)
tree41a2d30c99940dc8188988bec9388207f5de080a /source4/torture/nbt
parentee8f481d9422dff239a871d363da879a5776f7d9 (diff)
downloadsamba-384b9f709a16085e48469484a564ce0a7128af13.tar.gz
samba-384b9f709a16085e48469484a564ce0a7128af13.tar.bz2
samba-384b9f709a16085e48469484a564ce0a7128af13.zip
NBT-WINS: try to bind to port 137 in the NBT-WINS test
metze (from samba4wins tree 5e101475d5ed62060c991ea71c943e76b862aeef)
Diffstat (limited to 'source4/torture/nbt')
-rw-r--r--source4/torture/nbt/wins.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index 242c72e37d..68e52cf3ec 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -57,6 +57,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
const char *myaddress;
struct socket_address *socket_address;
struct interface *ifaces;
+ bool low_port = true;
load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
@@ -64,16 +65,27 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
socket_address = socket_address_from_strings(tctx,
nbtsock->sock->backend_name,
- myaddress, 0);
+ myaddress, lp_nbt_port(tctx->lp_ctx));
torture_assert(tctx, socket_address != NULL,
"Error getting address");
/* we do the listen here to ensure the WINS server receives the packets from
the right IP */
status = socket_listen(nbtsock->sock, socket_address, 0, 0);
- torture_assert_ntstatus_ok(tctx, status,
- "socket_listen for WINS failed");
talloc_free(socket_address);
+ if (!NT_STATUS_IS_OK(status)) {
+ low_port = false;
+ socket_address = socket_address_from_strings(tctx,
+ nbtsock->sock->backend_name,
+ myaddress, 0);
+ torture_assert(tctx, socket_address != NULL,
+ "Error getting address");
+
+ status = socket_listen(nbtsock->sock, socket_address, 0, 0);
+ talloc_free(socket_address);
+ torture_assert_ntstatus_ok(tctx, status,
+ "socket_listen for WINS failed");
+ }
torture_comment(tctx, "Testing name registration to WINS with name %s at %s nb_flags=0x%x\n",
nbt_name_string(tctx, name), myaddress, nb_flags);