diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-11-02 10:57:58 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-11-02 10:57:58 +0000 |
commit | d63eb4100f7a4d03e068f51536958fcbd96070f1 (patch) | |
tree | f24443099cf9b8dcb3f4c07670ac01005a0779bc /usr.sbin/bgpd/log.c | |
parent | c475e709d54116be4de1db072be4d4b4903ec4a9 (diff) |
supress logging of the (likely very long) repeated Connect -> Active ->
Connect -> Active state changes, just clutters logs, claudio ok
Diffstat (limited to 'usr.sbin/bgpd/log.c')
-rw-r--r-- | usr.sbin/bgpd/log.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index bfd1cbdc1b1..3fdc9f35049 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.39 2004/07/09 11:00:28 henning Exp $ */ +/* $OpenBSD: log.c,v 1.40 2004/11/02 10:57:57 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -250,6 +250,14 @@ log_statechange(const struct peer *peer, enum session_state nstate, { char *p; + /* don't clutter the logs with constant Connect -> Active -> Connect */ + if (nstate == STATE_CONNECT && peer->state == STATE_ACTIVE && + peer->prev_state == STATE_CONNECT) + return; + if (nstate == STATE_ACTIVE && peer->state == STATE_CONNECT && + peer->prev_state == STATE_ACTIVE) + return; + p = log_fmt_peer(&peer->conf); logit(LOG_INFO, "%s: state change %s -> %s, reason: %s", p, statenames[peer->state], statenames[nstate], eventnames[event]); |