From 28203f4bcaa37de26135530af5e9bdc71aabb52a Mon Sep 17 00:00:00 2001 From: Marco S Hyman Date: Thu, 1 Apr 2004 04:14:30 +0000 Subject: let rcmdsh work on hosts that don't have an ipv4 address. If it works it is fine with me -- millert@ --- lib/libc/net/rcmdsh.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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 @@ -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); } -- cgit v1.2.3