diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2004-04-01 04:14:30 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2004-04-01 04:14:30 +0000 |
commit | 28203f4bcaa37de26135530af5e9bdc71aabb52a (patch) | |
tree | 0f613ff37b5a182747b1accae51d50e0ed602661 | |
parent | 4de2bb9c879fcc5a75d76dc922018b5b58356023 (diff) |
let rcmdsh work on hosts that don't have an ipv4 address.
If it works it is fine with me -- millert@
-rw-r--r-- | lib/libc/net/rcmdsh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index 2a2a5d77fe3..3ec97e4763d 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.8 2003/05/05 22:13:03 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.8 2003/05/05 22:13:03 millert Exp $"; +static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.9 2004/04/01 04:14:29 marc Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -81,7 +81,8 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) /* Validate remote hostname. */ if (strcmp(*ahost, "localhost") != 0) { - if ((hp = gethostbyname(*ahost)) == NULL) { + if (((hp = gethostbyname2(*ahost, AF_INET)) == NULL) && + ((hp = gethostbyname2(*ahost, AF_INET6)) == NULL)) { herror(*ahost); return(-1); } |