summaryrefslogtreecommitdiff
path: root/whois.c
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2014-10-15 02:15:53 +0200
committerMarco d'Itri <md@linux.it>2014-10-15 02:15:53 +0200
commit257abceab316ce713f9af75e2a1ff7ad03e34254 (patch)
tree59de3e516c43196ec31e1334acb490a480dfef4b /whois.c
parent3957648d372db49208037bbc8fc125b8235806c2 (diff)
downloadwhois-257abceab316ce713f9af75e2a1ff7ad03e34254.tar.gz
Fix 1 and 2 octects in-addr.arpa queries
Queries like 85.in-addr.arpa and 94.85.in-addr.arpa were directed to the wrong server.
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/whois.c b/whois.c
index c3d2a1d..c4afc09 100644
--- a/whois.c
+++ b/whois.c
@@ -1247,7 +1247,11 @@ char *convert_inaddr(const char *s)
if (domcmp(endptr + 1, ".in-addr.arpa"))
return strdup("0.0.0.0");
+ } else {
+ c = b; b = a; a = 0;
}
+ } else {
+ c = a; a = 0;
}
new = malloc(sizeof("255.255.255.255"));