summaryrefslogtreecommitdiff
path: root/source4/torture/torture.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-18 20:13:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:09 -0500
commit1129c7808354dc04f7725be505fd23c0bf11a29d (patch)
tree3396a6b9f6833eb9819345fbeea644d250deb448 /source4/torture/torture.c
parent5f1f1e5e5c52ec8c453b5ea688f87004541cc5bd (diff)
downloadsamba-1129c7808354dc04f7725be505fd23c0bf11a29d.tar.gz
samba-1129c7808354dc04f7725be505fd23c0bf11a29d.tar.bz2
samba-1129c7808354dc04f7725be505fd23c0bf11a29d.zip
r1897: added a choose_called_name() function that allows us to more sanely
handle connections using the IP as the server name, while not trying for NBT name resolution on names like "192" and "192.168.1.2". also removed the ip address argument to smbcli_socket_connect() as it isn't used and doesn't really make sense. (This used to be commit 2ce4028842556328da4da0de9bee942bed02cc62)
Diffstat (limited to 'source4/torture/torture.c')
-rw-r--r--source4/torture/torture.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index c36ebde3cc..176475ff21 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -37,14 +37,11 @@ BOOL torture_showall = False;
static struct smbcli_state *open_nbt_connection(void)
{
struct nmb_name called, calling;
- struct in_addr ip;
struct smbcli_state *cli;
const char *host = lp_parm_string(-1, "torture", "host");
make_nmb_name(&calling, lp_netbios_name(), 0x0);
- make_nmb_name(&called , host, 0x20);
-
- zero_ip(&ip);
+ choose_called_name(&called, host, 0x20);
cli = smbcli_state_init();
if (!cli) {
@@ -52,7 +49,7 @@ static struct smbcli_state *open_nbt_connection(void)
return NULL;
}
- if (!smbcli_socket_connect(cli, host, &ip)) {
+ if (!smbcli_socket_connect(cli, host)) {
printf("Failed to connect with %s\n", host);
return cli;
}
@@ -64,7 +61,7 @@ static struct smbcli_state *open_nbt_connection(void)
* Well, that failed, try *SMBSERVER ...
* However, we must reconnect as well ...
*/
- if (!smbcli_socket_connect(cli, host, &ip)) {
+ if (!smbcli_socket_connect(cli, host)) {
printf("Failed to connect with %s\n", host);
return False;
}