summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2016-07-15 05:01:58 +0000
committerDamien Miller <djm@mindrot.org>2016-07-15 20:54:55 +1000
commitaf1f084857621f14bd9391aba8033d35886c2455 (patch)
tree7b5c94c1c698cb5bc8257653d45ef7eb6d3be9c7 /packet.c
parentbd5f2b78b69cf38d6049a0de445a79c8595e4a1f (diff)
upstream commit
Reduce the syslog level of some relatively common protocol events from LOG_CRIT by replacing fatal() calls with logdie(). Part of bz#2585, ok djm@ Upstream-ID: 9005805227c94edf6ac02a160f0e199638d288e5
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/packet.c b/packet.c
index 9839c94dd..3810f1128 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.231 2016/07/08 03:44:42 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.232 2016/07/15 05:01:58 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2073,24 +2073,19 @@ sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
2073{ 2073{
2074 switch (r) { 2074 switch (r) {
2075 case SSH_ERR_CONN_CLOSED: 2075 case SSH_ERR_CONN_CLOSED:
2076 logit("Connection closed by %.200s port %d", 2076 logdie("Connection closed by %.200s port %d",
2077 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); 2077 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
2078 cleanup_exit(255);
2079 case SSH_ERR_CONN_TIMEOUT: 2078 case SSH_ERR_CONN_TIMEOUT:
2080 logit("Connection %s %.200s port %d timed out", 2079 logdie("Connection %s %.200s port %d timed out",
2081 ssh->state->server_side ? "from" : "to", 2080 ssh->state->server_side ? "from" : "to",
2082 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); 2081 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
2083 cleanup_exit(255);
2084 case SSH_ERR_DISCONNECTED: 2082 case SSH_ERR_DISCONNECTED:
2085 logit("Disconnected from %.200s port %d", 2083 logdie("Disconnected from %.200s port %d",
2086 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); 2084 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
2087 cleanup_exit(255);
2088 case SSH_ERR_SYSTEM_ERROR: 2085 case SSH_ERR_SYSTEM_ERROR:
2089 if (errno == ECONNRESET) { 2086 if (errno == ECONNRESET)
2090 logit("Connection reset by %.200s port %d", 2087 logdie("Connection reset by %.200s port %d",
2091 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); 2088 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
2092 cleanup_exit(255);
2093 }
2094 /* FALLTHROUGH */ 2089 /* FALLTHROUGH */
2095 case SSH_ERR_NO_CIPHER_ALG_MATCH: 2090 case SSH_ERR_NO_CIPHER_ALG_MATCH:
2096 case SSH_ERR_NO_MAC_ALG_MATCH: 2091 case SSH_ERR_NO_MAC_ALG_MATCH:
@@ -2098,14 +2093,14 @@ sshpkt_fatal(struct ssh *ssh, const char *tag, int r)
2098 case SSH_ERR_NO_KEX_ALG_MATCH: 2093 case SSH_ERR_NO_KEX_ALG_MATCH:
2099 case SSH_ERR_NO_HOSTKEY_ALG_MATCH: 2094 case SSH_ERR_NO_HOSTKEY_ALG_MATCH:
2100 if (ssh && ssh->kex && ssh->kex->failed_choice) { 2095 if (ssh && ssh->kex && ssh->kex->failed_choice) {
2101 fatal("Unable to negotiate with %.200s port %d: %s. " 2096 logdie("Unable to negotiate with %.200s port %d: %s. "
2102 "Their offer: %s", ssh_remote_ipaddr(ssh), 2097 "Their offer: %s", ssh_remote_ipaddr(ssh),
2103 ssh_remote_port(ssh), ssh_err(r), 2098 ssh_remote_port(ssh), ssh_err(r),
2104 ssh->kex->failed_choice); 2099 ssh->kex->failed_choice);
2105 } 2100 }
2106 /* FALLTHROUGH */ 2101 /* FALLTHROUGH */
2107 default: 2102 default:
2108 fatal("%s%sConnection %s %.200s port %d: %s", 2103 logdie("%s%sConnection %s %.200s port %d: %s",
2109 tag != NULL ? tag : "", tag != NULL ? ": " : "", 2104 tag != NULL ? tag : "", tag != NULL ? ": " : "",
2110 ssh->state->server_side ? "from" : "to", 2105 ssh->state->server_side ? "from" : "to",
2111 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r)); 2106 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r));