From d62e65f4fe06deca5c4ce7dee957a9b517b80f12 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 12 Apr 2016 08:15:25 +0000 Subject: fsm: improve debug message Signed-off-by: ISHIDA Wataru --- server/fsm.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/fsm.go b/server/fsm.go index 34c8b187..f3d365f2 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -1049,7 +1049,8 @@ func (h *FSMHandler) sendMessageloop() error { } fsm.bgpMessageStateUpdate(m.Header.Type, false) - if m.Header.Type == bgp.BGP_MSG_NOTIFICATION { + switch m.Header.Type { + case bgp.BGP_MSG_NOTIFICATION: log.WithFields(log.Fields{ "Topic": "Peer", "Key": fsm.pConf.Config.NeighborAddress, @@ -1059,7 +1060,17 @@ func (h *FSMHandler) sendMessageloop() error { h.errorCh <- FSM_NOTIFICATION_SENT conn.Close() return fmt.Errorf("closed") - } else { + case bgp.BGP_MSG_UPDATE: + update := m.Body.(*bgp.BGPUpdate) + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": fsm.pConf.Config.NeighborAddress, + "State": fsm.state, + "nlri": update.NLRI, + "withdrawals": update.WithdrawnRoutes, + "attributes": update.PathAttributes, + }).Debug("sent update") + default: log.WithFields(log.Fields{ "Topic": "Peer", "Key": fsm.pConf.Config.NeighborAddress, -- cgit v1.2.3