summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-11-18 14:10:37 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-11-18 14:10:37 +0000
commitddfa0a74eae27b6f03c24a00186d80251eec965b (patch)
treed302c75be5fa0872b2c819603768a0887f284184 /usr.sbin/bgpd/session.c
parent3d35cbb5fe0e724e1909a259b9cb61a81936dbd5 (diff)
supress logging of subsequent connect() failures as long as:
-the session alternates between Active and Connect. Other states reset logging -the error is the same as the last connect() error seen jajajaja claudio
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index edc1e727544..a4bc8a1807d 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.199 2004/11/11 16:56:08 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.200 2004/11/18 14:10:36 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1022,7 +1022,9 @@ session_connect(struct peer *peer)
sa = addr2sa(&peer->conf.remote_addr, BGP_PORT);
if (connect(peer->fd, sa, sa->sa_len) == -1) {
if (errno != EINPROGRESS) {
- log_peer_warn(&peer->conf, "connect");
+ if (errno != peer->lasterr)
+ log_peer_warn(&peer->conf, "connect");
+ peer->lasterr = errno;
bgp_fsm(peer, EVNT_CON_OPENFAIL);
return (-1);
}