From f9d1b4422efb2c06e5472fb2c304712e2029796b Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 24 Nov 2015 12:41:35 -0500 Subject: [PATCH] net: reset nb->data per dns record lookup loop 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index 953f3bedd..89741dd7d 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)))