From daa2cbb7a339c8ebbb0e3d478aa939b7fbe6c64a Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 12 Jun 2015 16:52:00 +0900 Subject: server: check if local table exists for a neighbor Signed-off-by: ISHIDA Wataru --- server/server.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 105cdccb..43d0e51e 100644 --- a/server/server.go +++ b/server/server.go @@ -957,6 +957,14 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { // However, peer haven't target importpolicy when add PolicyDefinition of name only to the list. conInPolicyNames := peer.config.ApplyPolicy.ImportPolicies loc := server.localRibMap[peer.config.NeighborAddress.String()] + if loc == nil { + result := &GrpcResponse{ + ResponseErr: fmt.Errorf("no local rib for %s", peer.config.NeighborAddress.String()), + } + grpcReq.ResponseCh <- result + close(grpcReq.ResponseCh) + break + } for _, conInPolicyName := range conInPolicyNames { match := false for _, inPolicy := range loc.importPolicies { -- cgit v1.2.3