summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrist J. Clark <cjc@FreeBSD.org>2002-08-25 05:44:13 +0000
committerCrist J. Clark <cjc@FreeBSD.org>2002-08-25 05:44:13 +0000
commit0b3a80af0d3913933b26362ee30f47e87e18f13a (patch)
tree73548c065a14e4c9c3345f381ffd5c472081841a
parent6508a194aa95186d2ae6bfb93e3c7eb62e89d2f4 (diff)
Notes
-rw-r--r--sbin/ip6fw/ip6fw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/ip6fw/ip6fw.c b/sbin/ip6fw/ip6fw.c
index 9f145403abf7..7069e5bf34ae 100644
--- a/sbin/ip6fw/ip6fw.c
+++ b/sbin/ip6fw/ip6fw.c
@@ -548,13 +548,13 @@ lookup_host (host, addr, family)
char *host;
u_char *addr;
{
- struct hostent *he = gethostbyname2(host, family);
-
- if (!he)
- return(-1);
-
- memcpy(addr, he->h_addr_list[0], he->h_length);
+ struct hostent *he;
+ if (inet_pton(family, host, addr) != 1) {
+ if ((he = gethostbyname2(host, family)) == NULL)
+ return(-1);
+ memcpy(addr, he->h_addr_list[0], he->h_length);
+ }
return(0);
}