]> andersk Git - openssh.git/blobdiff - ssh-keyscan.c
- (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make
[openssh.git] / ssh-keyscan.c
index 9a91be499ec7c86fb2049190ee3f0daa71c9c3ae..086c0d345e2a703067f2fa16778c5e52df44ef29 100644 (file)
@@ -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.80 2009/12/25 19:40:21 stevesk 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,19 @@ main(int argc, char **argv)
                case '6':
                        IPv4or6 = AF_INET6;
                        break;
+               case 'V':
+#ifdef USE_ROUTINGDOMAIN
+                       scan_rdomain = a2rdomain(optarg);
+                       if (scan_rdomain == -1) {
+                               fprintf(stderr, "Bad rdomain '%s'\n", optarg);
+                               exit(1);
+                       }
+#else
+                       fprintf(stderr, "RoutingDomain not supported on this "
+                          "platform.\n");
+                       exit(1);
+#endif
+                       break;
                case '?':
                default:
                        usage();
This page took 0.038464 seconds and 4 git commands to generate.