summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-12 08:15:25 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-20 13:14:09 +0900
commitd62e65f4fe06deca5c4ce7dee957a9b517b80f12 (patch)
treec0541bc16c3b4b08b8e71e1ac66daa4ea23b3224 /server
parent2b60347cfd5bfc48303aba038a18770f006ff7a6 (diff)
fsm: improve debug message
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go15
1 files changed, 13 insertions, 2 deletions
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,