From 515abe28802b7062f3af080c0bd0187e2aa62280 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Fri, 13 Nov 2015 10:53:40 +0900 Subject: server: fix bmp and mrt updates Always must send updates to them. Signed-off-by: FUJITA Tomonori --- server/server.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/server/server.go b/server/server.go index a9c9c32f..52d917ac 100644 --- a/server/server.go +++ b/server/server.go @@ -783,22 +783,6 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg, incoming chan * case *bgp.MessageError: msgs = append(msgs, newSenderMsg(peer, []*bgp.BGPMessage{bgp.NewBGPNotificationMessage(m.TypeCode, m.SubTypeCode, m.Data)})) case *bgp.BGPMessage: - pathList, update, msgList := peer.handleBGPmessage(e) - if len(msgList) > 0 { - msgs = append(msgs, newSenderMsg(peer, msgList)) - break - } - if update == false { - if len(pathList) > 0 { - msgList := table.CreateUpdateMsgFromPaths(pathList) - msgs = append(msgs, newSenderMsg(peer, msgList)) - } - break - } else { - if len(pathList) > 0 { - server.roaClient.validate(pathList) - } - } if m.Header.Type == bgp.BGP_MSG_UPDATE { listener := make(map[watcher]chan watcherEvent) for _, watcher := range server.watchers { @@ -835,6 +819,23 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg, incoming chan * server.broadcastMsgs = append(server.broadcastMsgs, bm) } } + + pathList, update, msgList := peer.handleBGPmessage(e) + if len(msgList) > 0 { + msgs = append(msgs, newSenderMsg(peer, msgList)) + break + } + if update == false { + if len(pathList) > 0 { + msgList := table.CreateUpdateMsgFromPaths(pathList) + msgs = append(msgs, newSenderMsg(peer, msgList)) + } + break + } else { + if len(pathList) > 0 { + server.roaClient.validate(pathList) + } + } // FIXME: refactor peer.handleBGPmessage and this func if peer.isRouteServerClient() { var accepted []*table.Path -- cgit v1.2.3