From 45f760973d9b5c0663608e779eb337c0648e9313 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 13 Sep 2005 12:46:03 +0000 Subject: 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) --- source4/libcli/resolve/resolve.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/libcli/resolve') 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; -- cgit