summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go7
-rw-r--r--server/server.go6
2 files changed, 9 insertions, 4 deletions
diff --git a/server/peer.go b/server/peer.go
index f3b6caf0..226f21d1 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -80,7 +80,8 @@ func (peer *Peer) configuredRFlist() []bgp.RouteFamily {
return rfList
}
-func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]table.Path, bool) {
+func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]table.Path, bool, []*bgp.BGPMessage) {
+ bgpMsgList := []*bgp.BGPMessage{}
pathList := []table.Path{}
log.WithFields(log.Fields{
"Topic": "Peer",
@@ -164,7 +165,7 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]table.Path, bool) {
}).Warn("malformed BGP update message")
m := err.(*bgp.MessageError)
if m.TypeCode != 0 {
- peer.outgoing <- bgp.NewBGPNotificationMessage(m.TypeCode, m.SubTypeCode, m.Data)
+ bgpMsgList = append(bgpMsgList, bgp.NewBGPNotificationMessage(m.TypeCode, m.SubTypeCode, m.Data))
}
break
}
@@ -172,7 +173,7 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]table.Path, bool) {
pathList = table.ProcessMessage(m, peer.peerInfo)
peer.adjRib.UpdateIn(pathList)
}
- return pathList, update
+ return pathList, update, bgpMsgList
}
func (peer *Peer) getBests(loc *LocalRib) []table.Path {
diff --git a/server/server.go b/server/server.go
index d87bb742..e15e1360 100644
--- a/server/server.go
+++ b/server/server.go
@@ -510,7 +510,11 @@ 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 := peer.handleBGPmessage(m)
+ pathList, update, msgList := peer.handleBGPmessage(m)
+ if len(msgList) > 0 {
+ msgs = append(msgs, newSenderMsg(peer, msgList))
+ break
+ }
if update == false {
if len(pathList) > 0 {
msgList := table.CreateUpdateMsgFromPaths(pathList)