diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-10 07:17:32 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-10 07:17:32 +0900 |
commit | 794289f118b717f1931b5ac811430d37e3531a26 (patch) | |
tree | bc8b2d6974771563f83da3c1eabb5798dc86f663 /server/server.go | |
parent | ca832f94bbb1c8e0cecfd7118366a48159512e23 (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/server.go')
-rw-r--r-- | server/server.go | 6 |
1 files changed, 5 insertions, 1 deletions
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) |