From d5d99dad68ce2b935e1171e64aca8d4340ffae10 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 11 Nov 2015 22:05:16 +0900 Subject: 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 --- table/destination.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'table/destination.go') 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) -- cgit v1.2.3