summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/ipfw/ipfw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index 22332f147899..81e8868b2f60 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -20,7 +20,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: ipfw.c,v 1.67 1999/05/29 08:12:38 kris Exp $";
+ "$Id: ipfw.c,v 1.68 1999/06/02 05:59:48 ru Exp $";
#endif /* not lint */
@@ -612,13 +612,13 @@ lookup_host (host, ipaddr)
char *host;
struct in_addr *ipaddr;
{
- struct hostent *he = gethostbyname(host);
-
- if (!he)
- return(-1);
-
- *ipaddr = *(struct in_addr *)he->h_addr_list[0];
+ struct hostent *he;
+ if (!inet_aton(host, ipaddr)) {
+ if ((he = gethostbyname(host)) == NULL)
+ return(-1);
+ *ipaddr = *(struct in_addr *)he->h_addr_list[0];
+ }
return(0);
}