summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2005-06-04 22:50:20 +0000
committerhenning <henning@openbsd.org>2005-06-04 22:50:20 +0000
commitaf6ef2b49590f5ea93a727ceba2dab9761081a03 (patch)
tree1e2d3d444ece15b3e078f56b7259babab8abe732
parentundo last commit, all memory is already freed by udp_remove() (diff)
downloadwireguard-openbsd-af6ef2b49590f5ea93a727ceba2dab9761081a03.tar.xz
wireguard-openbsd-af6ef2b49590f5ea93a727ceba2dab9761081a03.zip
when sending out a notification record the error code and suberror code in
the peer stats struct, and clear them as soon as the session leaves IDLE
-rw-r--r--usr.sbin/bgpd/session.c8
-rw-r--r--usr.sbin/bgpd/session.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 58f0a2b969c..88016b21896 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.221 2005/06/04 07:07:34 henning Exp $ */
+/* $OpenBSD: session.c,v 1.222 2005/06/04 22:50:20 henning Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -578,6 +578,9 @@ bgp_fsm(struct peer *peer, enum session_events event)
return;
}
+ peer->stats.last_sent_errcode = 0;
+ peer->stats.last_sent_suberr = 0;
+
if (!peer->depend_ok)
peer->ConnectRetryTimer = 0;
else if (peer->conf.passive || peer->conf.template) {
@@ -1404,7 +1407,10 @@ session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode,
bgp_fsm(peer, EVNT_CON_FATAL);
return;
}
+
peer->stats.msg_sent_notification++;
+ peer->stats.last_sent_errcode = errcode;
+ peer->stats.last_sent_suberr = subcode;
}
int
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index b47628ea21e..950aeb425ea 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.76 2005/04/05 17:37:44 henning Exp $ */
+/* $OpenBSD: session.h,v 1.77 2005/06/04 22:50:20 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -145,6 +145,8 @@ struct peer_stats {
time_t last_updown;
time_t last_read;
u_int32_t prefix_cnt;
+ u_int8_t last_sent_errcode;
+ u_int8_t last_sent_suberr;
};
struct peer {