From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a1HbW-0005QO-Ly for mharc-grub-devel@gnu.org; Tue, 24 Nov 2015 12:42:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1HbT-0005Ok-Gg for grub-devel@gnu.org; Tue, 24 Nov 2015 12:42:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1HbP-0007xS-Eu for grub-devel@gnu.org; Tue, 24 Nov 2015 12:42:07 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:56681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1HbP-0007xM-90 for grub-devel@gnu.org; Tue, 24 Nov 2015 12:42:03 -0500 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tAOHfhf9008914; Tue, 24 Nov 2015 09:41:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=1AHHgDBJMp5XCPlEW/Y/sqQoE+/RiyLGvBj8UgPnj3w=; b=R1cCANRJ9ZWPz7yBEYbk95fIOqRN4cOuXS1tiH+1z4DbBBeJEGzXDqCuMuhoLlNi4sGV Cuk37AQ2gfAQUITtW58QJY6qovM02ZD3zjO/i9DTDHzT6nnzHVYV+slqjIM7nRNm8sLb tYzzNag4zPP3kpVh92aLcrFwWiXMl+27hP4= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 1ycu650dgt-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 24 Nov 2015 09:41:51 -0800 Received: from localhost (192.168.52.123) by mail.thefacebook.com (192.168.16.11) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 24 Nov 2015 09:41:38 -0800 From: Josef Bacik To: , , Subject: [PATCH REBASED] net: reset nb->data per dns record lookup loop Date: Tue, 24 Nov 2015 12:41:35 -0500 Message-ID: <1448386895-22013-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2015-11-24_11:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 67.231.153.30 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2015 17:42:08 -0000 We were resetting nb->data every time we tried a new server, but we need to do it every time we try for a different record, otherwise we don't end up falling back to the A record properly. Thanks, Signed-off-by: Josef Bacik --- -This is a rebase onto this mornings master. grub-core/net/dns.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index b7e951a..82a3307 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -568,11 +568,10 @@ grub_net_dns_lookup (const char *name, { grub_err_t err2; - nb->data = nbd; - grub_size_t t = 0; do { + nb->data = nbd; if (servers[j].option == DNS_OPTION_IPV4 || ((servers[j].option == DNS_OPTION_PREFER_IPV4) && (t++ == 0)) || ((servers[j].option == DNS_OPTION_PREFER_IPV6) && (t++ == 1))) -- 2.1.0