From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZylbP-0003Mt-KH for mharc-grub-devel@gnu.org; Tue, 17 Nov 2015 14:07:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZylbN-0003KZ-HB for grub-devel@gnu.org; Tue, 17 Nov 2015 14:07:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZylbI-0003SZ-HO for grub-devel@gnu.org; Tue, 17 Nov 2015 14:07:37 -0500 Received: from 66-220-155-178.intmwg.facebook.com ([66.220.155.178]:64308 helo=mx-out.facebook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZylbI-0003SO-Eb for grub-devel@gnu.org; Tue, 17 Nov 2015 14:07:32 -0500 Received: from facebook.com (2401:db00:2040:5012:face:0:9:0) by mx-out.facebook.com (10.223.101.97) with ESMTP id 7424cc9a8d5e11e58bf024be0595f910-139fd230 for ; Tue, 17 Nov 2015 11:07:31 -0800 Received: by devbig041.ash4.facebook.com (Postfix, from userid 8730) id E2C1E4542406; Tue, 17 Nov 2015 11:07:32 -0800 (PST) From: Josef Bacik To: grub-devel@gnu.org, kernel-team@fb.com Subject: [PATCH] net: reset nb->data per dns record lookup loop Date: Tue, 17 Nov 2015 11:07:31 -0800 Message-Id: <1447787251-1433231-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 66.220.155.178 Cc: Josef Bacik 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, 17 Nov 2015 19:07:38 -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 --- grub-core/net/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index c356318..9291aec 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -570,11 +570,11 @@ grub_net_dns_lookup (const char *name, grub_err_t err2; if (!sockets[j]) continue; - 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))) -- 1.8.1