summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2004-04-01 04:14:29 +0000
committermarc <marc@openbsd.org>2004-04-01 04:14:29 +0000
commit4deac02a57be607246fe9a3f9727904b252a7e23 (patch)
treebbe682fa15961de10c4040e9ed867bd9a244a56d /lib/libc
parentinit kqueues normally, from pedro martelletto (diff)
downloadwireguard-openbsd-4deac02a57be607246fe9a3f9727904b252a7e23.tar.xz
wireguard-openbsd-4deac02a57be607246fe9a3f9727904b252a7e23.zip
let rcmdsh work on hosts that don't have an ipv4 address.
If it works it is fine with me -- millert@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/rcmdsh.c7
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);
}