diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-13 10:53:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-13 10:53:40 +0900 |
commit | 515abe28802b7062f3af080c0bd0187e2aa62280 (patch) | |
tree | be97eb4ab8dba72c37e3a6bc6a90052e893ee255 /server | |
parent | 59f18c15ca7f809376d73a412b0d6351298b66fd (diff) |
server: fix bmp and mrt updates
Always must send updates to them.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 33 |
1 files 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 |