diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-01-28 21:15:47 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-29 09:08:07 +1100 |
commit | fae7bbe544cba7a9e5e4ab47ff6faa3d978646eb (patch) | |
tree | a27a07031b600a1925a128bc0f5258a4b3ab2e8c /ssh-keyscan.c | |
parent | 1a3d14f6b44a494037c7deab485abe6496bf2c60 (diff) |
upstream commit
avoid fatal() calls in packet code makes ssh-keyscan more
reliable against server failures ok dtucker@ markus@
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 25a257cc2..e59eacace 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keyscan.c,v 1.96 2015/01/20 23:14:00 deraadt Exp $ */ | 1 | /* $OpenBSD: ssh-keyscan.c,v 1.97 2015/01/28 21:15:47 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. | 3 | * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. |
4 | * | 4 | * |
@@ -319,8 +319,10 @@ tcpconnect(char *host) | |||
319 | memset(&hints, 0, sizeof(hints)); | 319 | memset(&hints, 0, sizeof(hints)); |
320 | hints.ai_family = IPv4or6; | 320 | hints.ai_family = IPv4or6; |
321 | hints.ai_socktype = SOCK_STREAM; | 321 | hints.ai_socktype = SOCK_STREAM; |
322 | if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) | 322 | if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) { |
323 | fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); | 323 | error("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); |
324 | return -1; | ||
325 | } | ||
324 | for (ai = aitop; ai; ai = ai->ai_next) { | 326 | for (ai = aitop; ai; ai = ai->ai_next) { |
325 | s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); | 327 | s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
326 | if (s < 0) { | 328 | if (s < 0) { |