summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-10 07:17:32 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-10 07:17:32 +0900
commit794289f118b717f1931b5ac811430d37e3531a26 (patch)
treebc8b2d6974771563f83da3c1eabb5798dc86f663 /server/peer.go
parentca832f94bbb1c8e0cecfd7118366a48159512e23 (diff)
server: server goroutin can't access to outstanding directly
This could lead to a deadlock. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go7
1 files changed, 4 insertions, 3 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 {