summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 07e1a5cd5..e541b4709 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: ssh-keyscan.c,v 1.41 2003/02/16 17:09:57 markus Exp $"); 10RCSID("$OpenBSD: ssh-keyscan.c,v 1.44 2003/06/28 16:23:06 deraadt Exp $");
11 11
12#include "openbsd-compat/sys-queue.h" 12#include "openbsd-compat/sys-queue.h"
13 13
@@ -31,11 +31,7 @@ RCSID("$OpenBSD: ssh-keyscan.c,v 1.41 2003/02/16 17:09:57 markus Exp $");
31 31
32/* Flag indicating whether IPv4 or IPv6. This can be set on the command line. 32/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
33 Default value is AF_UNSPEC means both IPv4 and IPv6. */ 33 Default value is AF_UNSPEC means both IPv4 and IPv6. */
34#ifdef IPV4_DEFAULT
35int IPv4or6 = AF_INET;
36#else
37int IPv4or6 = AF_UNSPEC; 34int IPv4or6 = AF_UNSPEC;
38#endif
39 35
40int ssh_port = SSH_DEFAULT_PORT; 36int ssh_port = SSH_DEFAULT_PORT;
41 37
@@ -397,7 +393,7 @@ tcpconnect(char *host)
397 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) 393 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
398 fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr)); 394 fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr));
399 for (ai = aitop; ai; ai = ai->ai_next) { 395 for (ai = aitop; ai; ai = ai->ai_next) {
400 s = socket(ai->ai_family, SOCK_STREAM, 0); 396 s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
401 if (s < 0) { 397 if (s < 0) {
402 error("socket: %s", strerror(errno)); 398 error("socket: %s", strerror(errno));
403 continue; 399 continue;
@@ -545,7 +541,7 @@ congreet(int s)
545 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", 541 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n",
546 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, 542 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2,
547 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); 543 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2);
548 if (atomicio(write, s, buf, n) != n) { 544 if (atomicio(vwrite, s, buf, n) != n) {
549 error("write (%s): %s", c->c_name, strerror(errno)); 545 error("write (%s): %s", c->c_name, strerror(errno));
550 confree(s); 546 confree(s);
551 return; 547 return;
@@ -685,7 +681,7 @@ fatal(const char *fmt,...)
685static void 681static void
686usage(void) 682usage(void)
687{ 683{
688 fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-f file]\n" 684 fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-t type] [-f file]\n"
689 "\t\t [host | addrlist namelist] [...]\n", 685 "\t\t [host | addrlist namelist] [...]\n",
690 __progname); 686 __progname);
691 exit(1); 687 exit(1);
@@ -701,7 +697,7 @@ main(int argc, char **argv)
701 extern int optind; 697 extern int optind;
702 extern char *optarg; 698 extern char *optarg;
703 699
704 __progname = get_progname(argv[0]); 700 __progname = ssh_get_progname(argv[0]);
705 init_rng(); 701 init_rng();
706 seed_rng(); 702 seed_rng();
707 TAILQ_INIT(&tq); 703 TAILQ_INIT(&tq);