summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-11 22:05:16 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-12 12:49:12 +0900
commitd5d99dad68ce2b935e1171e64aca8d4340ffae10 (patch)
treefd6db0614eb9a8b9a6636f719c6935583c8d481b /table/destination.go
parent16f7367a9ae0553e36f7debd995a67693f6980bd (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>
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go2
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)