On Fri, Apr 28, 2023 at 01:17:44PM +0200, Renaud Métrich wrote:
> When trying to resolve DNS names into IP addresses, the DNS code fails
> from time to time with the following error:
> -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< 
> --------
> error: ../../grub-core/net/dns.c:688:no DNS record found.
> -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< 
> --------
>
> This happens when both IPv4 and IPv6 queries are performed against the
> DNS server (e.g. 8.8.8.8) but there is no IP returned for IPv6 query, as
> shown below:
> -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< 
> --------
> grub> net_del_dns 192.168.122.1
> grub> net_add_dns 8.8.8.8
> grub> net_nslookup ipv4.test-ipv6.com
> error: ../../grub-core/net/dns.c:688:no DNS record found.
> grub> net_nslookup ipv4.test-ipv6.com
> 216.218.228.115
> -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< 
> --------
>
> The root cause is the code exiting prematurely when the data->addresses
> buffer has been allocated in recv_hook(), even if there was no address
> returned last time recv_hook() executed.
>
> This patch additionally simplifies the error handling.

And it even does more than that. Please split this patch into three patches:
  - simplify error handling,
  - add grub_dprintf() messages,
  - fix the issue described in the commit message.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to