summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/server/peer.go3
-rw-r--r--pkg/server/server.go3
2 files changed, 3 insertions, 3 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")
diff --git a/pkg/server/server.go b/pkg/server/server.go
index ed78d292..48cdc819 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -1695,13 +1695,12 @@ func (s *BgpServer) SetPolicies(ctx context.Context, r *api.SetPoliciesRequest)
"Topic": "Peer",
"Key": peer.fsm.pConf.State.NeighborAddress,
}).Info("call set policy")
+ peer.fsm.lock.RUnlock()
a, err := getConfig(peer.ID())
if err != nil {
- peer.fsm.lock.RUnlock()
return err
}
ap[peer.ID()] = *a
- peer.fsm.lock.RUnlock()
}
return s.policy.Reset(rp, ap)
}, false)