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

@@ -4321,6 +4321,7 @@ err:
new = opt_malloc(sizeof(struct host_record));
memset(new, 0, sizeof(struct host_record));
new->ttl = -1;
new->flags = 0;
while (arg)
{
@@ -4333,9 +4334,15 @@ err:
if (*dig == 0)
new->ttl = atoi(arg);
else if (inet_pton(AF_INET, arg, &addr.addr4))
new->addr = addr.addr4;
{
new->addr = addr.addr4;
new->flags |= HR_4;
}
else if (inet_pton(AF_INET6, arg, &addr.addr6))
new->addr6 = addr.addr6;
{
new->addr6 = addr.addr6;
new->flags |= HR_6;
}
else
{
int nomem;
@@ -5083,7 +5090,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
#define NOLOOP 1
#define TESTLOOP 2
/* Fill in TTL for CNAMES noe we have local_ttl.
/* Fill in TTL for CNAMES now we have local_ttl.
Also prepare to do loop detection. */
for (cn = daemon->cnames; cn; cn = cn->next)
{