summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-09 23:30:45 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-09 23:30:45 +0900
commit41ef6e5b62da686bc81d55c6b0d0b887bfa78d5b (patch)
treee32030d556ae19dce492cfa19431de4e66e309c7 /server
parent4e7ace6ade12150daddc7f1af97df614d6cbead6 (diff)
server: support adminDown'ed peer startup
The config file should be like: [Neighbors] [[Neighbors.NeighborList]] [Neighbors.NeighborList.NeighborConfig] PeerAs = 65001 NeighborAddress = "10.0.255.1" [Neighbors.NeighborList.NeighborState] AdminDown = true Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go
index ffba35f1..2b287dfb 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -130,13 +130,17 @@ func (fsm *FSM) bgpMessageStateUpdate(MessageType uint8, isIn bool) {
}
func NewFSM(gConf *config.Global, pConf *config.Neighbor) *FSM {
+ adminState := ADMIN_STATE_UP
+ if pConf.NeighborState.AdminDown == true {
+ adminState = ADMIN_STATE_DOWN
+ }
fsm := &FSM{
gConf: gConf,
pConf: pConf,
state: bgp.BGP_FSM_IDLE,
connCh: make(chan net.Conn),
opensentHoldTime: float64(HOLDTIME_OPENSENT),
- adminState: ADMIN_STATE_UP,
+ adminState: adminState,
adminStateCh: make(chan AdminState, 1),
getActiveCh: make(chan struct{}),
}