summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-10-15 07:45:33 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-10-15 07:45:33 +0000
commit41139815903eb7adfca707f5fdb591404e9ed71e (patch)
tree730877dd6f386c53be5094d6ff1d4a7b55f1ecea
parent0ea88f09f4e1ba3b8f4a9e389cc475b90c9ea2db (diff)
Add the FSM suberrors specified in draft-ietf-idr-fsm-subcode. This
should help identifying FSM errors since the state is know known. OK henning@ sthen@
-rw-r--r--usr.sbin/bgpd/bgpd.89
-rw-r--r--usr.sbin/bgpd/session.c11
-rw-r--r--usr.sbin/bgpd/session.h9
3 files changed, 22 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.8 b/usr.sbin/bgpd/bgpd.8
index de06f28aab6..c74b7268ba5 100644
--- a/usr.sbin/bgpd/bgpd.8
+++ b/usr.sbin/bgpd/bgpd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpd.8,v 1.38 2010/06/27 19:53:34 claudio Exp $
+.\" $OpenBSD: bgpd.8,v 1.39 2010/10/15 07:45:32 claudio Exp $
.\"
.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 27 2010 $
+.Dd $Mdocdate: October 15 2010 $
.Dt BGPD 8
.Os
.Sh NAME
@@ -211,6 +211,11 @@ control socket
.%T "Error Handling for Optional Transitive BGP Attributes"
.%D April 2009
.Re
+.Rs
+.%R draft-ietf-idr-fsm-subcode-00
+.%T "Subcodes for BGP Finite State Machine Error"
+.%D September 2010
+.Re
.Sh HISTORY
The
.Nm
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 55b232fc8f3..7274c7de2e8 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.311 2010/09/02 14:03:21 sobrado Exp $ */
+/* $OpenBSD: session.c,v 1.312 2010/10/15 07:45:32 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -753,7 +753,8 @@ bgp_fsm(struct peer *peer, enum session_events event)
change_state(peer, STATE_IDLE, event);
break;
default:
- session_notification(peer, ERR_FSM, 0, NULL, 0);
+ session_notification(peer,
+ ERR_FSM, ERR_FSM_UNEX_OPENSENT, NULL, 0);
change_state(peer, STATE_IDLE, event);
break;
}
@@ -787,7 +788,8 @@ bgp_fsm(struct peer *peer, enum session_events event)
change_state(peer, STATE_IDLE, event);
break;
default:
- session_notification(peer, ERR_FSM, 0, NULL, 0);
+ session_notification(peer,
+ ERR_FSM, ERR_FSM_UNEX_OPENCONFIRM, NULL, 0);
change_state(peer, STATE_IDLE, event);
break;
}
@@ -827,7 +829,8 @@ bgp_fsm(struct peer *peer, enum session_events event)
change_state(peer, STATE_IDLE, event);
break;
default:
- session_notification(peer, ERR_FSM, 0, NULL, 0);
+ session_notification(peer,
+ ERR_FSM, ERR_FSM_UNEX_ESTABLISHED, NULL, 0);
change_state(peer, STATE_IDLE, event);
break;
}
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index b06e69fd480..782e70789a7 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.108 2010/06/27 19:53:34 claudio Exp $ */
+/* $OpenBSD: session.h,v 1.109 2010/10/15 07:45:32 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -94,6 +94,13 @@ enum suberr_open {
ERR_OPEN_CAPA
};
+enum suberr_fsm {
+ ERR_FSM_UNSPECIFIC = 0,
+ ERR_FSM_UNEX_OPENSENT,
+ ERR_FSM_UNEX_OPENCONFIRM,
+ ERR_FSM_UNEX_ESTABLISHED
+};
+
enum opt_params {
OPT_PARAM_NONE,
OPT_PARAM_AUTH,