summaryrefslogtreecommitdiffstats
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-08 07:03:46 +0100
committerDarren Tucker <dtucker@zip.com.au>2010-01-08 07:03:46 +0100
commit34e314da1b832fee576e4ebd8b177154a45fec15 (patch)
tree0530be5f339034486b323ed96674f6291ab79d42 /ssh-keyscan.c
parent - andreas@cvs.openbsd.org 2009/10/24 11:23:42 (diff)
downloadopenssh-34e314da1b832fee576e4ebd8b177154a45fec15.tar.xz
openssh-34e314da1b832fee576e4ebd8b177154a45fec15.zip
- reyk@cvs.openbsd.org 2009/10/28 16:38:18
[ssh_config.5 sshd.c misc.h ssh-keyscan.1 readconf.h sshconnect.c channels.c channels.h servconf.h servconf.c ssh.1 ssh-keyscan.c scp.1 sftp.1 sshd_config.5 readconf.c ssh.c misc.c] Allow to set the rdomain in ssh/sftp/scp/sshd and ssh-keyscan. ok markus@
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 9a91be499..f30e85045 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.78 2009/01/22 10:02:34 djm Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.79 2009/10/28 16:38:18 reyk Exp $ */
/*
* Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
*
@@ -68,6 +68,9 @@ int timeout = 5;
int maxfd;
#define MAXCON (maxfd - 10)
+/* The default routing domain */
+int scan_rdomain = -1;
+
extern char *__progname;
fd_set *read_wait;
size_t read_wait_nfdset;
@@ -412,7 +415,8 @@ tcpconnect(char *host)
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr));
for (ai = aitop; ai; ai = ai->ai_next) {
- s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ s = socket_rdomain(ai->ai_family, ai->ai_socktype,
+ ai->ai_protocol, scan_rdomain);
if (s < 0) {
error("socket: %s", strerror(errno));
continue;
@@ -715,7 +719,7 @@ usage(void)
{
fprintf(stderr,
"usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n"
- "\t\t [host | addrlist namelist] ...\n",
+ "\t\t [-V rdomain] [host | addrlist namelist] ...\n",
__progname);
exit(1);
}
@@ -741,7 +745,7 @@ main(int argc, char **argv)
if (argc <= 1)
usage();
- while ((opt = getopt(argc, argv, "Hv46p:T:t:f:")) != -1) {
+ while ((opt = getopt(argc, argv, "Hv46p:T:t:f:V:")) != -1) {
switch (opt) {
case 'H':
hash_hosts = 1;
@@ -802,6 +806,11 @@ main(int argc, char **argv)
case '6':
IPv4or6 = AF_INET6;
break;
+ case 'V':
+ scan_rdomain = a2port(optarg);
+ if (scan_rdomain < 0)
+ scan_rdomain = -1;
+ break;
case '?':
default:
usage();