summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/grpc_server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-23 20:51:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-23 21:01:03 +0900
commit79a461c147ed58150a3d6653fb3440fe24018c8a (patch)
treeb91bf21d40aff0d03b09d93ef8e89596939164e7 /pkg/server/grpc_server.go
parentdbd0c21d2e97877de7a2d24ab975984c33371442 (diff)
api: move remote_cap and local_cap to PeerState from PeerConf
Both should be in PeerState like OpenConfig. Also remove unused supported_capabilities. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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