Fix crash in PXE/netboot when DNS server disabled.

This commit is contained in:
Simon Kelley
2021-10-19 15:33:41 +01:00
parent 37a70d39e0
commit 9560658c5b
3 changed files with 12 additions and 5 deletions

View File

@@ -11,6 +11,10 @@ version 2.87
Add --filter-A and --filter-AAAA options, to remove IPv4 or IPv6 Add --filter-A and --filter-AAAA options, to remove IPv4 or IPv6
addresses from DNS answers. addresses from DNS answers.
Fix crash doing netbooting when --port is set to zero
to disable the DNS server. Thanks to Drexl Johannes
for the bug report.
version 2.86 version 2.86
Handle DHCPREBIND requests in the DHCPv6 server code. Handle DHCPREBIND requests in the DHCPv6 server code.

1
debian/changelog vendored
View File

@@ -2,6 +2,7 @@ dnsmasq (2.87-1) unstable; urgency=low
* New upstream. * New upstream.
* Include new NFTset support in the build. * Include new NFTset support in the build.
* Fix crash on netboot with DNS server disabled. (closes: #996332)
-- Simon Kelley <simon@thekelleys.org.uk> Wed, 08 Sep 2021 23:11:25 +0000 -- Simon Kelley <simon@thekelleys.org.uk> Wed, 08 Sep 2021 23:11:25 +0000

View File

@@ -1399,6 +1399,8 @@ struct in_addr a_record_from_hosts(char *name, time_t now)
struct crec *crecp = NULL; struct crec *crecp = NULL;
struct in_addr ret; struct in_addr ret;
/* If no DNS service, cache not initialised. */
if (daemon->port != 0)
while ((crecp = cache_find_by_name(crecp, name, now, F_IPV4))) while ((crecp = cache_find_by_name(crecp, name, now, F_IPV4)))
if (crecp->flags & F_HOSTS) if (crecp->flags & F_HOSTS)
return crecp->addr.addr4; return crecp->addr.addr4;