diff options
-rw-r--r-- | pkg/server/peer.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/server/peer.go b/pkg/server/peer.go index 1f67fd48..632e14a4 100644 --- a/pkg/server/peer.go +++ b/pkg/server/peer.go @@ -282,8 +282,9 @@ func (peer *Peer) llgrFamilies() ([]bgp.RouteFamily, []bgp.RouteFamily) { func (peer *Peer) isLLGREnabledFamily(family bgp.RouteFamily) bool { peer.fsm.lock.RLock() - defer peer.fsm.lock.RUnlock() - if !peer.fsm.pConf.GracefulRestart.Config.LongLivedEnabled { + llgrEnabled := peer.fsm.pConf.GracefulRestart.Config.LongLivedEnabled + peer.fsm.lock.RUnlock() + if !llgrEnabled { return false } fs, _ := peer.llgrFamilies() |