diff options
author | Toshiki Tsuchiya <taruta0811@gmail.com> | 2020-01-04 15:55:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2020-01-05 20:56:43 +0900 |
commit | 543f50ded98b7c6da29bdd70246d1c8e17ab93cd (patch) | |
tree | 8d2f72df8890a9211ee340fd2a4eddde1c44a0ec /pkg/server/grpc_server.go | |
parent | a4b688a25ffca6eca74db36876d107c104cfb147 (diff) |
gobgpd: use map for validation table
`Table.destinations` is a map, so the order changes.
This commit allows to get validate information from path by using map for validate table
Fix: https://github.com/osrg/gobgp/issues/2223
Signed-off-by: Toshiki Tsuchiya <taruta0811@gmail.com>
Diffstat (limited to 'pkg/server/grpc_server.go')
-rw-r--r-- | pkg/server/grpc_server.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go index 215a1866..69af445c 100644 --- a/pkg/server/grpc_server.go +++ b/pkg/server/grpc_server.go @@ -160,11 +160,11 @@ func toPathApi(path *table.Path, v *table.Validation) *api.Path { return toPathAPI(nil, nil, anyNlri, anyPattrs, path, v) } -func getValidation(v []*table.Validation, i int) *table.Validation { +func getValidation(v map[*table.Path]*table.Validation, p *table.Path) *table.Validation { if v == nil { return nil } else { - return v[i] + return v[p] } } |