summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/hostcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/hostcheck.c')
-rw-r--r--Utilities/cmcurl/lib/hostcheck.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Utilities/cmcurl/lib/hostcheck.c b/Utilities/cmcurl/lib/hostcheck.c
index 49dbab3..cf267a7 100644
--- a/Utilities/cmcurl/lib/hostcheck.c
+++ b/Utilities/cmcurl/lib/hostcheck.c
@@ -36,7 +36,7 @@
#include "hostcheck.h"
#include "strcase.h"
-#include "inet_pton.h"
+#include "hostip.h"
#include "curl_memory.h"
/* The last #include file should be: */
@@ -67,10 +67,6 @@ static int hostmatch(char *hostname, char *pattern)
const char *pattern_label_end, *pattern_wildcard, *hostname_label_end;
int wildcard_enabled;
size_t prefixlen, suffixlen;
- struct in_addr ignored;
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 si6;
-#endif
/* normalize pattern and hostname by stripping off trailing dots */
size_t len = strlen(hostname);
@@ -86,12 +82,8 @@ static int hostmatch(char *hostname, char *pattern)
CURL_HOST_MATCH : CURL_HOST_NOMATCH;
/* detect IP address as hostname and fail the match if so */
- if(Curl_inet_pton(AF_INET, hostname, &ignored) > 0)
- return CURL_HOST_NOMATCH;
-#ifdef ENABLE_IPV6
- if(Curl_inet_pton(AF_INET6, hostname, &si6.sin6_addr) > 0)
+ if(Curl_host_is_ipnum(hostname))
return CURL_HOST_NOMATCH;
-#endif
/* We require at least 2 dots in pattern to avoid too wide wildcard
match. */