Support CIDR queries to whois.arin.net

This is a behaviour change: in this case the client used to use the
parameters for non-CIDR queries, so the server would return nothing.
Now an exact match for the provided ip/length query is requested.

If the query is not an exact match then this is also different from the
default behaviour of the server, which is to return a non-verbose
summary of all less specific networks.
This commit is contained in:
Marco d'Itri 2020-10-03 14:29:16 +02:00
parent 326d220078
commit 751c9cc397

View File

@ -693,7 +693,10 @@ char *queryformat(const char *server, const char *flags, const char *query)
strcat(buf, "a ");
strcat(buf, query + 2);
} else if (myinet_aton(query) || strchr(query, ':')) {
strcat(buf, "n + ");
if (strchr(query, '/'))
strcat(buf, "r + = ");
else
strcat(buf, "n + ");
strcat(buf, query);
} else
strcat(buf, query);