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 <jbacik@fb.com>
This commit is contained in:
Josef Bacik 2015-11-24 12:41:35 -05:00 committed by Andrei Borzenkov
parent 6a46cbcc5c
commit f9d1b4422e

View file

@ -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)))