summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-16 20:32:27 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-08-16 20:32:27 +0900
commit0b6486f34ccbb16962ecd3d73e08a85c57fadde7 (patch)
tree9ffa530564aa012fff1f1668b57e7f4c9ca5fcdc
parent834fb80a886b0234980fe5368419b81705ed5a23 (diff)
gobgp: fix peer state print
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--cmd/gobgp/cmd/neighbor.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/gobgp/cmd/neighbor.go b/cmd/gobgp/cmd/neighbor.go
index 73670196..6bd531a6 100644
--- a/cmd/gobgp/cmd/neighbor.go
+++ b/cmd/gobgp/cmd/neighbor.go
@@ -162,7 +162,7 @@ func showNeighbors(vrf string) error {
fmt.Printf(format, "Peer", "AS", "Up/Down", "State", "#Received", "Accepted")
formatFsm := func(admin api.PeerState_AdminState, fsm api.PeerState_SessionState) string {
switch admin {
- case api.PeerState_UP:
+ case api.PeerState_DOWN:
return "Idle(Admin)"
case api.PeerState_PFX_CT:
return "Idle(PfxCt)"
@@ -170,8 +170,11 @@ func showNeighbors(vrf string) error {
switch fsm {
case api.PeerState_UNKNOWN:
- return "Idle"
+ // should never happen
+ return "Unknown"
case api.PeerState_IDLE:
+ return "Idle"
+ case api.PeerState_CONNECT:
return "Connect"
case api.PeerState_ACTIVE:
return "Active"