- make bcast name resolution match other name resolution modules for
authorAndrew Tridgell <tridge@samba.org>
Tue, 30 Sep 2008 15:42:12 +0000 (08:42 -0700)
committerAndrew Tridgell <tridge@samba.org>
Tue, 30 Sep 2008 15:46:00 +0000 (08:46 -0700)
  host not found errors

- when we have no resolve context return NT_STATUS_OBJECT_NAME_NOT_FOUND

source4/libcli/resolve/bcast.c
source4/libcli/resolve/resolve.c

index 2e2eb05397fc64668320f5ef00abdab54fd650ed..ca78a2ce43985588b3c50ac87354f630a36dac13 100644 (file)
@@ -75,7 +75,13 @@ struct composite_context *resolve_name_bcast_send(TALLOC_CTX *mem_ctx,
 NTSTATUS resolve_name_bcast_recv(struct composite_context *c, 
                                 TALLOC_CTX *mem_ctx, const char **reply_addr)
 {
-       return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr);
+       NTSTATUS status = resolve_name_nbtlist_recv(c, mem_ctx, reply_addr);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
+               /* this makes much more sense for a bcast name resolution
+                  timeout */
+               status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+       return status;
 }
 
 /*
index 2b14591d68f6c802261a69c05a35eff4085aec7b..dbc4a2ede749a58ac7e1686d94cbf654ea712f69 100644 (file)
@@ -166,7 +166,7 @@ struct composite_context *resolve_name_send(struct resolve_context *ctx,
 
        state->method = ctx->methods;
        if (state->method == NULL) {
-               composite_error(c, NT_STATUS_HOST_UNREACHABLE);
+               composite_error(c, NT_STATUS_BAD_NETWORK_NAME);
                return c;
        }
        state->creq = setup_next_method(c);