Fix breakage of --local=/domain.name/1.2.3.4 in immediately previous commit.

This commit is contained in:
Simon Kelley
2022-11-06 20:18:27 +00:00
parent 2d8905dafd
commit 5b868c213b

View File

@@ -2977,9 +2977,9 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
if (servers_only && option == 'S') if (servers_only && option == 'S')
flags |= SERV_FROM_FILE; flags |= SERV_FROM_FILE;
while (parse_server_next(&sdetails)) while ((flags & SERV_LITERAL_ADDRESS) || parse_server_next(&sdetails))
{ {
if ((err = parse_server_addr(&sdetails))) if (!(flags & SERV_LITERAL_ADDRESS) && (err = parse_server_addr(&sdetails)))
ret_err(err); ret_err(err);
/* When source is set only use DNS records of the same type and skip all others */ /* When source is set only use DNS records of the same type and skip all others */
@@ -3009,7 +3009,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
domain += strlen(domain) + 1; domain += strlen(domain) + 1;
} }
if (flags & SERV_LITERAL_ADDRESS)
break;
} }
if (sdetails.resolved) if (sdetails.resolved)
freeaddrinfo(sdetails.hostinfo); freeaddrinfo(sdetails.hostinfo);