summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-26 07:23:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:04 -0500
commit528bb470bd138df2de742be696bb31191f9da492 (patch)
treed3263aaea9a21d4ebeda710c4c0e68e7ae1ab480 /source4
parent41b6e94665dd1586ba483ee4a98b059c90531f3c (diff)
downloadsamba-528bb470bd138df2de742be696bb31191f9da492.tar.gz
samba-528bb470bd138df2de742be696bb31191f9da492.tar.bz2
samba-528bb470bd138df2de742be696bb31191f9da492.zip
r8776: fixed SMB connections for IP addresses, even when name resolve order
doesn't include 'host' (This used to be commit 77a1e3076a8d5c711fc96a69dd1a58c00d1f9604)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/composite/connect.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source4/libcli/composite/connect.c b/source4/libcli/composite/connect.c
index b1d2eb2847..d6d87380ec 100644
--- a/source4/libcli/composite/connect.c
+++ b/source4/libcli/composite/connect.c
@@ -341,17 +341,24 @@ struct composite_context *smb_composite_connect_send(struct smb_composite_connec
if (state->sock == NULL) goto failed;
state->io = io;
- state->stage = CONNECT_RESOLVE;
c->state = SMBCLI_REQUEST_SEND;
c->event_ctx = talloc_reference(c, state->sock->event.ctx);
c->private = state;
- make_nbt_name_server(&name, io->in.dest_host);
+ /* if the destination is an IP address, then skip the name resolution part */
+ if (is_ipaddress(io->in.dest_host)) {
+ state->stage = CONNECT_SOCKET;
+ state->creq = smbcli_sock_connect_send(state->sock, io->in.dest_host,
+ state->io->in.port,
+ io->in.dest_host);
+ } else {
+ state->stage = CONNECT_RESOLVE;
+ make_nbt_name_server(&name, io->in.dest_host);
+ state->creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order());
+ }
- state->creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order());
if (state->creq == NULL) goto failed;
-
state->creq->async.private = c;
state->creq->async.fn = composite_handler;