diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-11-11 22:05:16 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-12 12:49:12 +0900 |
commit | d5d99dad68ce2b935e1171e64aca8d4340ffae10 (patch) | |
tree | fd6db0614eb9a8b9a6636f719c6935583c8d481b | |
parent | 16f7367a9ae0553e36f7debd995a67693f6980bd (diff) |
table: fix how to mark a path as best in ToApiStruct()
When two peers advertise exactly same path, one will be marked as best, and
another will not. In this case, in ToApiStruct(), we mustn't mark a path
as best by Equal() method since Equal() compare path's content, not identity.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | table/destination.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/table/destination.go b/table/destination.go index f5d30f29..9c7b4f91 100644 --- a/table/destination.go +++ b/table/destination.go @@ -152,7 +152,7 @@ func (dd *Destination) ToApiStruct() *api.Destination { ret := make([]*api.Path, 0, len(arg)) for _, p := range arg { pp := p.ToApiStruct() - if dd.GetBestPath().Equal(p) { + if dd.GetBestPath() == p { pp.Best = true } ret = append(ret, pp) |