diff options
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r-- | server/grpc_server.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go index 12337403..15b45e5b 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -679,8 +679,8 @@ func (s *Server) DeleteVrf(ctx context.Context, arg *api.DeleteVrfRequest) (*api } func (s *Server) AddNeighbor(ctx context.Context, arg *api.AddNeighborRequest) (*api.AddNeighborResponse, error) { - c, err := func(a *api.Peer) (*config.Neighbor, error) { - pconf := &config.Neighbor{} + c, err := func(a *api.Peer) (config.Neighbor, error) { + pconf := config.Neighbor{} if a.Conf != nil { pconf.Config.NeighborAddress = a.Conf.NeighborAddress pconf.Config.PeerAs = a.Conf.PeerAs @@ -789,21 +789,13 @@ func (s *Server) AddNeighbor(ctx context.Context, arg *api.AddNeighborRequest) ( if err != nil { return nil, err } - d, err := s.get(REQ_ADD_NEIGHBOR, c) - if err != nil { - return nil, err - } - return d.(*api.AddNeighborResponse), err + return &api.AddNeighborResponse{}, s.bgpServer.AddNeighbor(&c) } func (s *Server) DeleteNeighbor(ctx context.Context, arg *api.DeleteNeighborRequest) (*api.DeleteNeighborResponse, error) { - d, err := s.get(REQ_DELETE_NEIGHBOR, &config.Neighbor{Config: config.NeighborConfig{ + return &api.DeleteNeighborResponse{}, s.bgpServer.DeleteNeighbor(&config.Neighbor{Config: config.NeighborConfig{ NeighborAddress: arg.Peer.Conf.NeighborAddress, }}) - if err != nil { - return nil, err - } - return d.(*api.DeleteNeighborResponse), err } func NewPrefixFromApiStruct(a *api.Prefix) (*table.Prefix, error) { |