From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 24 19:30:05 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF5F61065677 for ; Wed, 24 Jun 2009 19:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A1D4C8FC1F for ; Wed, 24 Jun 2009 19:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5OJU5ed012352 for ; Wed, 24 Jun 2009 19:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5OJU5Wh012351; Wed, 24 Jun 2009 19:30:05 GMT (envelope-from gnats) Resent-Date: Wed, 24 Jun 2009 19:30:05 GMT Resent-Message-Id: <200906241930.n5OJU5Wh012351@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Libor Forst Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C79106572F for ; Wed, 24 Jun 2009 19:25:54 +0000 (UTC) (envelope-from forst@betynka.ms.mff.cuni.cz) Received: from smtp1.ms.mff.cuni.cz (smtp1.ms.mff.cuni.cz [IPv6:2001:718:1e03:801::4]) by mx1.freebsd.org (Postfix) with ESMTP id 01DBB8FC18 for ; Wed, 24 Jun 2009 19:25:53 +0000 (UTC) (envelope-from forst@betynka.ms.mff.cuni.cz) Received: from kernun-e.ms.mff.cuni.cz (kernun-e.ms.mff.cuni.cz [195.113.19.101]) by smtp1.ms.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id n5OJPoRt087499; Wed, 24 Jun 2009 21:25:51 +0200 (CEST) (envelope-from forst@betynka.ms.mff.cuni.cz) Received: from betynka.ms.mff.cuni.cz (betynka.ms.mff.cuni.cz [195.113.19.78]) by kernun-e.ms.mff.cuni.cz with ESMTP id 4KGJS0400018OYQ0AFB; Wed, 24 Jun 2009 21:14:09 +0200 (CEST) Received: from betynka.ms.mff.cuni.cz (localhost [127.0.0.1]) by betynka.ms.mff.cuni.cz (8.14.3/8.14.2) with ESMTP id n5OJPnUs043190 for ; Wed, 24 Jun 2009 21:25:49 +0200 (CEST) (envelope-from forst@betynka.ms.mff.cuni.cz) Received: (from forst@localhost) by betynka.ms.mff.cuni.cz (8.14.3/8.14.3/Submit) id n5OJPnJF043189; Wed, 24 Jun 2009 21:25:49 +0200 (CEST) (envelope-from forst) Message-Id: <200906241925.n5OJPnJF043189@betynka.ms.mff.cuni.cz> Date: Wed, 24 Jun 2009 21:25:49 +0200 (CEST) From: Libor Forst To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/136013: Resolver wrong diagnostics X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Libor Forst List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 19:30:06 -0000 >Number: 136013 >Category: kern >Synopsis: Resolver wrong diagnostics >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 24 19:30:04 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Libor Forst >Release: FreeBSD 7.1-RELEASE-p5 i386 >Organization: Charles University, Prague >Environment: System: FreeBSD betynka.ms.mff.cuni.cz 7.1-RELEASE-p5 FreeBSD 7.1-RELEASE-p5 #0: Fri May 29 11:44:20 CEST 2009 root@kernun-e.ms.mff.cuni.cz:/usr/obj/usr/src/sys/YQ-MINIMAL i386 >Description: The res_searchN() function makes a decision about loop continuation after returning from the res_querydomainN() call based on two pieces of information: res->res_h_errno and hp->rcode. However, if the query was made for both A and AAAA RRs, the hp address points just to the first res_target structure, but the res->res_h_errno will be set by the result of the second query. Thus, res->res_h_errno and hp->rcode can be inconsistent. >How-To-Repeat: At least two-domains search-list, query for a name without dots, the first (A) response should be NXDomain, the second (AAAA) should be ServFail. In this situation, the first res_querydomainN() call (for the NAME.DOMAIN1) returns with res->res_h_errno == TRY_AGAIN (according to the second query) but hp->rcode == NXDomain (because hp reflects the first res_target). As such, the second domain will not be tried (in spite of that in all three other combinations of results, the domain is tried). >Fix: 1. Both pieces of information (h_errno and rcode) must be consistent. I.e. the rcode should be saved e.g. into res_state structure (as a new res_rcode member?). 2. The question is, whether the result (h_errno+rcode) should really be defined as "last query result". Why the responses NXDomain (A) and ServFail (AAAA) bring a different behavior than the case of ServFail (A) and NXDomain (AAAA)? Maybe the final result selection should not follow "the last" response but "the most relevant" one. >Release-Note: >Audit-Trail: >Unformatted: