diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-05-08 21:31:58 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-05-08 21:31:58 +0900 |
commit | b36107ef849de13a7ca84948ce41e6d09b222cb3 (patch) | |
tree | d945e6d84fc7d634af529b01c5f7e1887770b256 /server/fsm.go | |
parent | 24b12a642d6ab36198ee020f973d2c44832771d1 (diff) |
server: keepalive interval should be honor a negotiated hold time
If a negotiated hold time is smaller than a configured hold time, we use
one third of the negotiated hold time for a keepalive interval.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r-- | server/fsm.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/fsm.go b/server/fsm.go index d657b404..53cfc55c 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -511,6 +511,9 @@ func (h *FSMHandler) openconfirm() bgp.FSMState { h.holdTimer = &time.Timer{} } else { sec := time.Second * time.Duration(fsm.peerConfig.Timers.KeepaliveInterval) + if fsm.negotiatedHoldTime < fsm.peerConfig.Timers.HoldTime { + sec = time.Second * time.Duration(fsm.negotiatedHoldTime) / 3 + } fsm.keepaliveTicker = time.NewTicker(sec) // RFC 4271 P.65 |