Skip to content

Commit

Permalink
server: fix ListPolicyAssignmet() with empty name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fujita committed Jan 27, 2019
1 parent 1e133bd commit 36572f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/server/server.go
Expand Up @@ -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)
Expand Down

0 comments on commit 36572f8

Please sign in to comment.