summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/grpc_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/server/grpc_server.go')
-rw-r--r--pkg/server/grpc_server.go20
1 files changed, 11 insertions, 9 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go
index 386fa45c..ae317bb4 100644
--- a/pkg/server/grpc_server.go
+++ b/pkg/server/grpc_server.go
@@ -578,16 +578,18 @@ func newNeighborFromAPIStruct(a *api.Peer) (*config.Neighbor, error) {
pconf.Config.RemovePrivateAs = config.REMOVE_PRIVATE_AS_OPTION_REPLACE
}
- localCaps, err := apiutil.UnmarshalCapabilities(a.Conf.LocalCap)
- if err != nil {
- return nil, err
- }
- remoteCaps, err := apiutil.UnmarshalCapabilities(a.Conf.RemoteCap)
- if err != nil {
- return nil, err
+ if a.State != nil {
+ localCaps, err := apiutil.UnmarshalCapabilities(a.State.LocalCap)
+ if err != nil {
+ return nil, err
+ }
+ remoteCaps, err := apiutil.UnmarshalCapabilities(a.State.RemoteCap)
+ if err != nil {
+ return nil, err
+ }
+ pconf.State.LocalCapabilityList = localCaps
+ pconf.State.RemoteCapabilityList = remoteCaps
}
- pconf.State.LocalCapabilityList = localCaps
- pconf.State.RemoteCapabilityList = remoteCaps
pconf.State.RemoteRouterId = a.Conf.Id