diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-11-23 20:51:04 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-11-23 21:01:03 +0900 |
commit | 79a461c147ed58150a3d6653fb3440fe24018c8a (patch) | |
tree | b91bf21d40aff0d03b09d93ef8e89596939164e7 /pkg | |
parent | dbd0c21d2e97877de7a2d24ab975984c33371442 (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')
-rw-r--r-- | pkg/server/grpc_server.go | 20 |
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 |