From owner-cvs-src@FreeBSD.ORG Tue Apr 20 17:56:39 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FC1D16A4CE; Tue, 20 Apr 2004 17:56:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2950243D1D; Tue, 20 Apr 2004 17:56:39 -0700 (PDT) (envelope-from njl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i3L0ucGe050061; Tue, 20 Apr 2004 17:56:38 -0700 (PDT) (envelope-from njl@repoman.freebsd.org) Received: (from njl@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i3L0ucEK050060; Tue, 20 Apr 2004 17:56:38 -0700 (PDT) (envelope-from njl) Message-Id: <200404210056.i3L0ucEK050060@repoman.freebsd.org> From: Nate Lawson Date: Tue, 20 Apr 2004 17:56:38 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc/net res_query.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 00:56:39 -0000 njl 2004/04/20 17:56:38 PDT FreeBSD src repository Modified files: lib/libc/net res_query.c Log: MFdragonfly: resolver fix for timeouts on unqualified hostnames res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND* hp->rcode == SERVFAIL. However, there are cases such as timeouts where rcode is not always set to SERVFAIL. This leads to inconsistent nameserver operation during multi-domain and truncated dot searches, especially during booting when portions of the network are being brought up simultanious with dns lookups. This patch attempts to correct the problem by unconditionally terminating the search if TRY_AGAIN is returned (after res_query has gone through all retries and name servers) instead of trying other domain elements in the domain seach path. This patch should fix reported problems (which I can reproduce) with some NFS mounts failing during boot. This occured because mount_nfs thought the host name lookup returned a definitive failure using a non-dotted host name when, in fact, it timed out on the first part (host.search.domain.name) and got a definitive host-not-found response on the second part (host.). Generally speaking, search path name server timeouts can exceed 60 seconds per element and most machines which consistently timeout on earlier portions of a search path are effectively non-operational due to the imposed delays. It is more important for DNS lookups to return the proper error code then to be able to recover a valid lookup in later portions of the search path in these situations. Obtained from: DragonFly MFC after: 3 weeks Revision Changes Path 1.28 +18 -5 src/lib/libc/net/res_query.c