diff options
author | Eiichiro Watanabe <a16tochjp@gmail.com> | 2019-01-12 00:51:23 +0900 |
---|---|---|
committer | Eiichiro Watanabe <a16tochjp@gmail.com> | 2019-01-12 00:51:23 +0900 |
commit | 61d7a5e90bae220a45accf9914604ea568ae8c4a (patch) | |
tree | e1f8fcc5944043ea2310512c975ec2049f748fad /pkg/server/fsm.go | |
parent | 98d8925b82766f21f49378172a3c0763054a619a (diff) |
server: Fix peer down reason code in BMP
Diffstat (limited to 'pkg/server/fsm.go')
-rw-r--r-- | pkg/server/fsm.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go index 319f1eb6..56b2c35e 100644 --- a/pkg/server/fsm.go +++ b/pkg/server/fsm.go @@ -39,15 +39,6 @@ const ( minConnectRetryInterval = 10 ) -type peerDownReason int - -const ( - peerDownByLocal peerDownReason = iota - peerDownByLocalWithoutNotification - peerDownByRemote - peerDownByRemoteWithoutNotification -) - type fsmStateReasonType uint8 const ( @@ -70,26 +61,13 @@ const ( type fsmStateReason struct { Type fsmStateReasonType - peerDownReason peerDownReason BGPNotification *bgp.BGPMessage Data []byte } func newfsmStateReason(typ fsmStateReasonType, notif *bgp.BGPMessage, data []byte) *fsmStateReason { - var reasonCode peerDownReason - switch typ { - case fsmDying, fsmInvalidMsg, fsmNotificationSent, fsmHoldTimerExpired, fsmIdleTimerExpired, fsmRestartTimerExpired: - reasonCode = peerDownByLocal - case fsmAdminDown: - reasonCode = peerDownByLocalWithoutNotification - case fsmNotificationRecv, fsmGracefulRestart, fsmHardReset: - reasonCode = peerDownByRemote - case fsmReadFailed, fsmWriteFailed: - reasonCode = peerDownByRemoteWithoutNotification - } return &fsmStateReason{ Type: typ, - peerDownReason: reasonCode, BGPNotification: notif, Data: data, } @@ -1892,7 +1870,6 @@ func (h *fsmHandler) loop(ctx context.Context, wg *sync.WaitGroup) error { reason := fsm.reason if fsm.h.sentNotification != nil { reason.Type = fsmNotificationSent - reason.peerDownReason = peerDownByLocal reason.BGPNotification = fsm.h.sentNotification } log.WithFields(log.Fields{ |