summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/server/fsm.go b/server/fsm.go
index 48f4e095..01587668 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -109,6 +109,7 @@ type AdminState int
const (
ADMIN_STATE_UP AdminState = iota
ADMIN_STATE_DOWN
+ ADMIN_STATE_PFX_CT
)
func (s AdminState) String() string {
@@ -117,6 +118,8 @@ func (s AdminState) String() string {
return "ADMIN_STATE_UP"
case ADMIN_STATE_DOWN:
return "ADMIN_STATE_DOWN"
+ case ADMIN_STATE_PFX_CT:
+ return "ADMIN_STATE_PFX_CT"
default:
return "Unknown"
}
@@ -1086,15 +1089,14 @@ func (h *FSMHandler) sendMessageloop() error {
}
}
if m.Notification != nil {
+ if m.StayIdle {
+ // current user is only prefix-limit
+ // fix me if this is not the case
+ h.changeAdminState(ADMIN_STATE_PFX_CT)
+ }
if err := send(m.Notification); err != nil {
return nil
}
- if m.StayIdle {
- select {
- case h.fsm.adminStateCh <- ADMIN_STATE_DOWN:
- default:
- }
- }
}
case <-ticker.C:
if err := send(bgp.NewBGPKeepAliveMessage()); err != nil {
@@ -1272,7 +1274,7 @@ func (h *FSMHandler) changeAdminState(s AdminState) error {
"State": fsm.state,
}).Info("Administrative start")
- case ADMIN_STATE_DOWN:
+ case ADMIN_STATE_DOWN, ADMIN_STATE_PFX_CT:
log.WithFields(log.Fields{
"Topic": "Peer",
"Key": fsm.pConf.Config.NeighborAddress,