summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h4
-rw-r--r--whois.c37
2 files changed, 0 insertions, 41 deletions
diff --git a/config.h b/config.h
index df4fed6..112d14c 100644
--- a/config.h
+++ b/config.h
@@ -60,10 +60,6 @@
/* FIXME: which systems lack this? */
#define HAVE_GETTIMEOFDAY
-/* FIXME: disabled because it does not parse addresses with a netmask length.
- * The code using it needs to be either fixed or removed.
-#define HAVE_INET_PTON
-*/
/*
* Please send patches to correctly ignore old releases which lack a RNG
diff --git a/whois.c b/whois.c
index 365d618..8b91c7a 100644
--- a/whois.c
+++ b/whois.c
@@ -36,9 +36,6 @@
#elif defined HAVE_LIBIDN
#include <idna.h>
#endif
-#ifdef HAVE_INET_PTON
-#include <arpa/inet.h>
-#endif
/* Application-specific */
#include "version.h"
@@ -541,12 +538,7 @@ char *guess_server(const char *s)
return strdup(whereas32(as32));
/* smells like an IP? */
-#ifdef HAVE_INET_PTON
- if (inet_pton(AF_INET, s, &ip) > 0) {
- ip = ntohl(ip);
-#else
if ((ip = myinet_aton(s))) {
-#endif
for (i = 0; ip_assign[i].serv; i++)
if ((ip & ip_assign[i].mask) == ip_assign[i].net)
return strdup(ip_assign[i].serv);
@@ -1260,18 +1252,6 @@ void split_server_port(const char *const input,
char *convert_6to4(const char *s)
{
char *new;
-
-#ifdef HAVE_INET_PTON
- struct in6_addr ipaddr;
- unsigned char *ip;
-
- if (inet_pton(AF_INET6, s, &ipaddr) <= 0)
- return strdup("0.0.0.0");
-
- ip = (unsigned char *)&ipaddr;
- new = malloc(sizeof("255.255.255.255"));
- sprintf(new, "%d.%d.%d.%d", *(ip + 2), *(ip + 3), *(ip + 4), *(ip + 5));
-#else
int items;
unsigned int a, b;
char c;
@@ -1290,7 +1270,6 @@ char *convert_6to4(const char *s)
new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%u.%u.%u.%u", a >> 8, a & 0xff, b >> 8, b & 0xff);
-#endif
return new;
}
@@ -1298,19 +1277,6 @@ char *convert_6to4(const char *s)
char *convert_teredo(const char *s)
{
char *new;
-
-#ifdef HAVE_INET_PTON
- struct in6_addr ipaddr;
- unsigned char *ip;
-
- if (inet_pton(AF_INET6, s, &ipaddr) <= 0)
- return strdup("0.0.0.0");
-
- ip = (unsigned char *)&ipaddr;
- new = malloc(sizeof("255.255.255.255"));
- sprintf(new, "%d.%d.%d.%d", *(ip + 12) ^ 0xff, *(ip + 13) ^ 0xff,
- *(ip + 14) ^ 0xff, *(ip + 15) ^ 0xff);
-#else
unsigned int a, b;
if (sscanf(s, "2001:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%*[^:]:%x:%x", &a, &b) != 2)
@@ -1320,7 +1286,6 @@ char *convert_teredo(const char *s)
b ^= 0xffff;
new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%u.%u.%u.%u", a >> 8, a & 0xff, b >> 8, b & 0xff);
-#endif
return new;
}
@@ -1361,7 +1326,6 @@ char *convert_inaddr(const char *s)
return new;
}
-#ifndef HAVE_INET_PTON
unsigned long myinet_aton(const char *s)
{
unsigned long a, b, c, d;
@@ -1377,7 +1341,6 @@ unsigned long myinet_aton(const char *s)
return 0;
return (a << 24) + (b << 16) + (c << 8) + d;
}
-#endif
unsigned long asn32_to_long(const char *s)
{