Author: tridge Date: 2005-07-26 07:23:11 +0000 (Tue, 26 Jul 2005) New Revision: 8776
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8776 Log: fixed SMB connections for IP addresses, even when name resolve order doesn't include 'host' Modified: branches/SAMBA_4_0/source/libcli/composite/connect.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/composite/connect.c =================================================================== --- branches/SAMBA_4_0/source/libcli/composite/connect.c 2005-07-26 06:37:20 UTC (rev 8775) +++ branches/SAMBA_4_0/source/libcli/composite/connect.c 2005-07-26 07:23:11 UTC (rev 8776) @@ -341,17 +341,24 @@ 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;
