Don't silently discard all-zeroes adddresses in --host-record.

This commit is contained in:
Simon Kelley
2019-10-25 17:46:49 +01:00
parent 1292e1a557
commit 157d8cfd6a
3 changed files with 15 additions and 6 deletions

View File

@@ -1290,7 +1290,7 @@ void cache_reload(void)
for (hr = daemon->host_records; hr; hr = hr->next)
for (nl = hr->names; nl; nl = nl->next)
{
if (hr->addr.s_addr != 0 &&
if ((hr->flags & HR_4) &&
(cache = whine_malloc(SIZEOF_POINTER_CREC)))
{
cache->name.namep = nl->name;
@@ -1299,7 +1299,7 @@ void cache_reload(void)
add_hosts_entry(cache, (union all_addr *)&hr->addr, INADDRSZ, SRC_CONFIG, (struct crec **)daemon->packet, revhashsz);
}
if (!IN6_IS_ADDR_UNSPECIFIED(&hr->addr6) &&
if ((hr->flags & HR_6) &&
(cache = whine_malloc(SIZEOF_POINTER_CREC)))
{
cache->name.namep = nl->name;