summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-11-02 10:56:49 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-11-02 10:56:49 +0000
commitc475e709d54116be4de1db072be4d4b4903ec4a9 (patch)
tree809759e4437231fad6d06e4c47729de3ac59d2e4
parent37d5753786c5fb2bb40cad2f1ecf5f991dc3c323 (diff)
save the previous state in struct peer, claudio ok
-rw-r--r--usr.sbin/bgpd/session.c7
-rw-r--r--usr.sbin/bgpd/session.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 1b0f138a990..b803be5830f 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.196 2004/10/19 12:02:50 henning Exp $ */
+/* $OpenBSD: session.c,v 1.197 2004/11/02 10:56:48 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -879,6 +879,7 @@ change_state(struct peer *peer, enum session_state state,
mrt_dump_state(mrt, peer->state, state,
peer, conf);
}
+ peer->prev_state = peer->state;
peer->state = state;
}
@@ -2071,7 +2072,7 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt)
if ((p = calloc(1, sizeof(struct peer))) ==
NULL)
fatal("new_peer");
- p->state = STATE_NONE;
+ p->state = p->prev_state = STATE_NONE;
p->next = npeers;
npeers = p;
reconf = RECONF_REINIT;
@@ -2402,7 +2403,7 @@ getpeerbyip(struct sockaddr *ip)
}
newpeer->conf.template = 0;
newpeer->conf.cloned = 1;
- newpeer->state = STATE_NONE;
+ newpeer->state = newpeer->prev_state = STATE_NONE;
newpeer->rbuf = NULL;
init_peer(newpeer);
bgp_fsm(newpeer, EVNT_START);
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index f12507644b3..ca5367ca35e 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.64 2004/10/19 12:02:50 henning Exp $ */
+/* $OpenBSD: session.h,v 1.65 2004/11/02 10:56:48 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -168,6 +168,7 @@ struct peer {
u_int32_t remote_bgpid;
u_int16_t holdtime;
enum session_state state;
+ enum session_state prev_state;
time_t ConnectRetryTimer;
time_t KeepaliveTimer;
time_t HoldTimer;