s3: Fix IO_TIMEOUT handling for wins queries
authorVolker Lendecke <vl@samba.org>
Sun, 12 Jun 2011 13:44:19 +0000 (15:44 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 12 Jun 2011 15:07:47 +0000 (17:07 +0200)
source3/libsmb/namequery.c

index 5969f656c1b37ed8a7788df29c2b18bf0e2e48cf..a4b2258b33607f005350bf078639e2bfdd029d0a 100644 (file)
@@ -1423,9 +1423,18 @@ NTSTATUS name_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                req, struct name_query_state);
        NTSTATUS status;
 
-       if (tevent_req_is_nterror(req, &status)
-           && !NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
-               return status;
+       if (tevent_req_is_nterror(req, &status)) {
+               if (state->bcast &&
+                   NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
+                       /*
+                        * In the broadcast case we collect replies until the
+                        * timeout.
+                        */
+                       status = NT_STATUS_OK;
+               }
+               if (!NT_STATUS_IS_OK(status)) {
+                       return status;
+               }
        }
        if (state->num_addrs == 0) {
                return NT_STATUS_NOT_FOUND;