summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/peer.go
diff options
context:
space:
mode:
authorEiichiro Watanabe <a16tochjp@gmail.com>2018-11-10 17:27:15 +0900
committerEiichiro Watanabe <a16tochjp@gmail.com>2018-11-10 18:35:17 +0900
commit360f72818b60d471da1bf8cd673272e927595d4a (patch)
tree85c230dbe1d59fc96b1f45886ae180c1d5a996a2 /pkg/server/peer.go
parent076d019b75c058456f64b97c90b48f69c7dd1877 (diff)
server: avoid deadlock
peer.ID() uses lock in itself.
Diffstat (limited to 'pkg/server/peer.go')
-rw-r--r--pkg/server/peer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/server/peer.go b/pkg/server/peer.go
index 1c2e7d41..83a5d12f 100644
--- a/pkg/server/peer.go
+++ b/pkg/server/peer.go
@@ -215,6 +215,7 @@ func (peer *peer) negotiatedRFList() []bgp.RouteFamily {
}
func (peer *peer) toGlobalFamilies(families []bgp.RouteFamily) []bgp.RouteFamily {
+ id := peer.ID()
peer.fsm.lock.RLock()
defer peer.fsm.lock.RUnlock()
if peer.fsm.pConf.Config.Vrf != "" {
@@ -228,7 +229,7 @@ func (peer *peer) toGlobalFamilies(families []bgp.RouteFamily) []bgp.RouteFamily
default:
log.WithFields(log.Fields{
"Topic": "Peer",
- "Key": peer.ID(),
+ "Key": id,
"Family": f,
"VRF": peer.fsm.pConf.Config.Vrf,
}).Warn("invalid family configured for neighbor with vrf")