diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/log.c | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index 3fdc9f35049..bfa14db69d7 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.40 2004/11/02 10:57:57 henning Exp $ */ +/* $OpenBSD: log.c,v 1.41 2004/11/18 14:10:36 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -258,6 +258,7 @@ log_statechange(const struct peer *peer, enum session_state nstate, peer->prev_state == STATE_ACTIVE) return; + peer->lasterr = 0; p = log_fmt_peer(&peer->conf); logit(LOG_INFO, "%s: state change %s -> %s, reason: %s", p, statenames[peer->state], statenames[nstate], eventnames[event]); 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); } diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index ca5367ca35e..4b6e8fe149c 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.65 2004/11/02 10:56:48 henning Exp $ */ +/* $OpenBSD: session.h,v 1.66 2004/11/18 14:10:36 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -182,6 +182,7 @@ struct peer { struct buf_read *rbuf; u_int8_t auth_established; u_int8_t depend_ok; + int lasterr; struct peer *next; }; |