summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-06-12 16:52:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-16 06:22:11 +0900
commitdaa2cbb7a339c8ebbb0e3d478aa939b7fbe6c64a (patch)
tree090ed02a9c94b20defd5adeb537ff1705488b03f /server
parent5f2b37d487fa815a8ca994edd6d47e0af91b93b2 (diff)
server: check if local table exists for a neighbor
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/server.go8
1 files changed, 8 insertions, 0 deletions
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 {