Fix whois queries for ARIN AS numbers.
The ARIN whois server likes AS number queries to be in the form "a 8075" rather than "as7085".
This commit is contained in:
parent
aefd0bb44b
commit
b951056e8c
@ -431,9 +431,13 @@ whois(const char *query, const char *hostname, int flags)
|
||||
else if ((flags & WHOIS_SPAM_ME) ||
|
||||
strchr(query, ' ') != NULL)
|
||||
fprintf(fp, "%s\r\n", query);
|
||||
else if (strcasecmp(hostname, ANICHOST) == 0)
|
||||
fprintf(fp, "+ %s\r\n", query);
|
||||
else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0)
|
||||
else if (strcasecmp(hostname, ANICHOST) == 0) {
|
||||
if (strncasecmp(query, "AS", 2) == 0 &&
|
||||
strspn(query+2, "0123456789") == strlen(query+2))
|
||||
fprintf(fp, "+ a %s\r\n", query+2);
|
||||
else
|
||||
fprintf(fp, "+ %s\r\n", query);
|
||||
} else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0)
|
||||
fprintf(fp, "domain %s\r\n", query);
|
||||
else
|
||||
fprintf(fp, "%s\r\n", query);
|
||||
|
Loading…
Reference in New Issue
Block a user