From: claudio Date: Wed, 24 Aug 2022 17:14:02 +0000 (+0000) Subject: Put the 'connection from non-peer' log message behind a verbose logging check. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=06af690f26fdd4a12253880e6a6c9456b682ebb9;p=openbsd Put the 'connection from non-peer' log message behind a verbose logging check. In many cases the message is just flooding the logs. In some cases it may help to identify a missing neighbor for those cases log verbose can be used. OK deraadt@ denis@ --- diff --git a/usr.sbin/bgpd/logmsg.c b/usr.sbin/bgpd/logmsg.c index 605a750e802..b50c205956f 100644 --- a/usr.sbin/bgpd/logmsg.c +++ b/usr.sbin/bgpd/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.8 2022/07/28 13:11:48 deraadt Exp $ */ +/* $OpenBSD: logmsg.c,v 1.9 2022/08/24 17:14:02 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -213,11 +213,11 @@ void log_conn_attempt(const struct peer *peer, struct sockaddr *sa, socklen_t len) { char *p; - const char *b; if (peer == NULL) { /* connection from non-peer, drop */ - b = log_sockaddr(sa, len); - logit(LOG_INFO, "connection from non-peer %s refused", b); + if (log_getverbose()) + logit(LOG_INFO, "connection from non-peer %s refused", + log_sockaddr(sa, len)); } else { /* only log if there is a chance that the session may come up */ if (peer->conf.down && peer->state == STATE_IDLE)