From 54d89bf4aa72b98702cac3d107fe13e9d411bfee Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Mon, 8 Oct 2001 19:05:06 +0000 Subject: some more IPv4or6 cleanup --- usr.bin/ssh/ssh-keyscan.c | 6 +----- usr.bin/ssh/ssh.c | 4 ++-- usr.bin/ssh/sshconnect.c | 12 ++++-------- usr.bin/ssh/sshconnect.h | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) (limited to 'usr.bin/ssh') diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 08af3ccdf23..f3df3b6538e 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.29 2001/08/30 22:22:32 markus Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.30 2001/10/08 19:05:05 markus Exp $"); #include #include @@ -32,11 +32,7 @@ RCSID("$OpenBSD: ssh-keyscan.c,v 1.29 2001/08/30 22:22:32 markus Exp $"); /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ -#ifdef IPV4_DEFAULT -int IPv4or6 = AF_INET; -#else int IPv4or6 = AF_UNSPEC; -#endif int ssh_port = SSH_DEFAULT_PORT; diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index bf48b5f2639..dcac2b22ab1 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.146 2001/10/01 21:38:53 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.147 2001/10/08 19:05:05 markus Exp $"); #include #include @@ -661,7 +661,7 @@ again: /* Open a connection to the remote host. */ - cerr = ssh_connect(host, &hostaddr, options.port, + cerr = ssh_connect(host, &hostaddr, options.port, IPv4or6, options.connection_attempts, original_effective_uid != 0 || !options.use_privileged_port, pw, options.proxy_command); diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index c73b876d107..4841f73e892 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.114 2001/10/08 16:15:47 markus Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.115 2001/10/08 19:05:05 markus Exp $"); #include @@ -38,9 +38,6 @@ char *server_version_string = NULL; extern Options options; extern char *__progname; -/* AF_UNSPEC or AF_INET or AF_INET6 */ -extern int IPv4or6; - static const char * sockaddr_ntop(struct sockaddr *sa) { @@ -239,9 +236,8 @@ ssh_create_socket(struct passwd *pw, int privileged, int family) */ int ssh_connect(const char *host, struct sockaddr_storage * hostaddr, - u_short port, int connection_attempts, - int anonymous, struct passwd *pw, - const char *proxy_command) + u_short port, int family, int connection_attempts, + int anonymous, struct passwd *pw, const char *proxy_command) { int gaierr; int on = 1; @@ -275,7 +271,7 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, /* No proxy command. */ memset(&hints, 0, sizeof(hints)); - hints.ai_family = IPv4or6; + hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", port); if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) diff --git a/usr.bin/ssh/sshconnect.h b/usr.bin/ssh/sshconnect.h index 27ed2b74515..b475adde0df 100644 --- a/usr.bin/ssh/sshconnect.h +++ b/usr.bin/ssh/sshconnect.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.h,v 1.12 2001/06/26 17:27:25 markus Exp $ */ +/* $OpenBSD: sshconnect.h,v 1.13 2001/10/08 19:05:05 markus Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -27,7 +27,7 @@ #define SSHCONNECT_H int -ssh_connect(const char *, struct sockaddr_storage *, u_short, int, +ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int, int, struct passwd *, const char *); void -- cgit v1.2.3