summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2022-08-24 17:14:03 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2022-08-24 17:14:03 +0000
commitf91621b10b3c58472485d40829dcbd22b74757f2 (patch)
tree608b36e2f22a9b7b84dbe17688f9f1f1ce67b146 /usr.sbin
parent385ce3172878091dfc980a91660ce85cb0001f3a (diff)
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/logmsg.c8
1 files changed, 4 insertions, 4 deletions
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 <henning@openbsd.org>
@@ -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)