summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd/log.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-12-03 19:20:35 +0000
committerclaudio <claudio@openbsd.org>2009-12-03 19:20:35 +0000
commit445b3ae2db4141734684e2398a0fa92e0850a0f8 (patch)
tree43006c063aafbc8dfd1272a1573b92d3b6020a89 /usr.sbin/bgpd/log.c
parentfix typos and blanks (diff)
downloadwireguard-openbsd-445b3ae2db4141734684e2398a0fa92e0850a0f8.tar.xz
wireguard-openbsd-445b3ae2db4141734684e2398a0fa92e0850a0f8.zip
Only log if there is a chance that the session may come up if the neighbor
is administrativly down save the electrons for more important messages. After a short discussion with Elisa Jasinska from ams-ix. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/log.c')
-rw-r--r--usr.sbin/bgpd/log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c
index e2708cbc95d..4bb061fadec 100644
--- a/usr.sbin/bgpd/log.c
+++ b/usr.sbin/bgpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.52 2009/12/01 14:28:05 claudio Exp $ */
+/* $OpenBSD: log.c,v 1.53 2009/12/03 19:20:35 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -327,6 +327,9 @@ log_conn_attempt(const struct peer *peer, struct sockaddr *sa)
b = log_sockaddr(sa);
logit(LOG_INFO, "connection from non-peer %s refused", b);
} else {
+ /* only log if there is a chance that the session may come up */
+ if (peer->conf.down && peer->state == STATE_IDLE)
+ return;
p = log_fmt_peer(&peer->conf);
logit(LOG_INFO, "Connection attempt from %s while session is "
"in state %s", p, statenames[peer->state]);