summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/peer.go b/server/peer.go
index bc8bb10c..51893421 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -300,6 +300,8 @@ func (peer *Peer) loop() error {
peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))
peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now()
peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++
+ } else {
+ peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = time.Now()
}
sameState := true
@@ -325,7 +327,6 @@ func (peer *Peer) loop() error {
sameState = false
if oldState == bgp.BGP_FSM_ESTABLISHED {
t := time.Now()
- peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = t
if t.Sub(peer.fsm.peerConfig.BgpNeighborCommonState.Uptime) < FLOP_THRESHOLD {
peer.fsm.peerConfig.BgpNeighborCommonState.Flops++
}