summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-13 12:46:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:08 -0500
commit45f760973d9b5c0663608e779eb337c0648e9313 (patch)
tree8021224e493f613ec4107f531519a44059cff048 /source4/libcli/resolve
parent6bfea6335620083f3fd8b47a297c7c0140fb33c1 (diff)
downloadsamba-45f760973d9b5c0663608e779eb337c0648e9313.tar.gz
samba-45f760973d9b5c0663608e779eb337c0648e9313.tar.bz2
samba-45f760973d9b5c0663608e779eb337c0648e9313.zip
r10200: added a composite_trigger_done() call that allows a composite function
to cause an event to happen immediately. This allows metzes patch for recognising IPs in resolve_name() to work, and also allows us to remove some of the other code where we currently do specific checks for is_ipaddress(). (This used to be commit 9cc000d868e1257ef6429f6f6f1f9d3c28ca330f)
Diffstat (limited to 'source4/libcli/resolve')
-rw-r--r--source4/libcli/resolve/resolve.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index 733eddf643..d62890434b 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -144,6 +144,15 @@ struct composite_context *resolve_name_send(struct nbt_name *name, struct event_
c->event_ctx = talloc_reference(c, event_ctx);
}
+ if (is_ipaddress(state->name.name) ||
+ strcasecmp(state->name.name, "localhost") == 0) {
+ struct ipv4_addr ip = interpret_addr2(state->name.name);
+ state->reply_addr = talloc_strdup(state, sys_inet_ntoa(ip));
+ if (!state->reply_addr) goto failed;
+ composite_trigger_done(c);
+ return c;
+ }
+
state->req = setup_next_method(c);
if (state->req == NULL) goto failed;