diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-01-27 21:33:25 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-01-27 21:33:25 +0900 |
commit | 36572f85fc0164019689aad6b24e9dccbf6a09ba (patch) | |
tree | 5350fc1af3842201e03487af2d2e2ee12a8d957c | |
parent | 1e133bd50141bb294dd63cd0f9f70f69c2b60422 (diff) |
server: fix ListPolicyAssignmet() with empty name
if the name isn't specified, the assignment of the global and route
server clients. Non route server client doesn't have the assignment.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
-rw-r--r-- | pkg/server/server.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go index 3a7ab371..cd78f3fb 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -3258,8 +3258,10 @@ func (s *BgpServer) ListPolicyAssignment(ctx context.Context, r *api.ListPolicyA names := make([]string, 0, len(s.neighborMap)+1) if r.Name == "" { names = append(names, table.GLOBAL_RIB_NAME) - for name := range s.neighborMap { - names = append(names, name) + for name, peer := range s.neighborMap { + if peer.isRouteServerClient() { + names = append(names, name) + } } } else { names = append(names, r.Name) |