mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +00:00
ARIN has annoyingly started using caps when referencing
whois.apnic.net. To properly receive hints for recursive IP searches, we convert a buffer to lowercase before searching for magic words. PR: 42834 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> (mostly) X-MFC-After: re approval
This commit is contained in:
parent
994ad1809e
commit
d0505643e5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103530
@ -252,7 +252,7 @@ whois(const char *query, const char *hostname, int flags)
|
||||
struct addrinfo *hostres, *res;
|
||||
char *buf, *host, *nhost, *p;
|
||||
int i, s;
|
||||
size_t len;
|
||||
size_t c, len;
|
||||
|
||||
hostres = gethostinfo(hostname, 1);
|
||||
for (res = hostres; res; res = res->ai_next) {
|
||||
@ -292,6 +292,8 @@ whois(const char *query, const char *hostname, int flags)
|
||||
s_asprintf(&nhost, "%.*s",
|
||||
(int)(buf + len - host), host);
|
||||
} else if (strcmp(hostname, ANICHOST) == 0) {
|
||||
for (c = 0; c <= len; c++)
|
||||
buf[c] = tolower((int)buf[c]);
|
||||
for (i = 0; ip_whois[i] != NULL; i++) {
|
||||
if (strnstr(buf, ip_whois[i], len) !=
|
||||
NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user