diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-29 19:25:35 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-29 19:25:35 +0900 |
commit | ae80d1bf8628655acc46bf044265fea73a2e9a76 (patch) | |
tree | 662998da7d28b927ad0a7eb2f8dc01a76954dab9 /table | |
parent | 43e015854c85a41afd49ee66256e9f81d08d0c09 (diff) |
Revert "table: fix to compare new best path with old best path"
This reverts commit 74c0527dda13032dabd5dd4b7034115827fd2a46.
Fix this in a different way.
Diffstat (limited to 'table')
-rw-r--r-- | table/destination.go | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/table/destination.go b/table/destination.go index 8153bf3f..d192f53d 100644 --- a/table/destination.go +++ b/table/destination.go @@ -254,26 +254,7 @@ func (dest *Destination) Calculate(ids []string) (map[string]*Path, []*Path) { return nil }() best := dest.GetBestPath(id) - equal := func(lhs, rhs *Path) bool { - // already know the NLRIs are same and - // timestamp must be ignored so check out only - // source. - if lhs.GetSource() != rhs.GetSource() { - return false - } - - pattrs := func(arg []bgp.PathAttributeInterface) []byte { - ret := make([]byte, 0) - for _, a := range arg { - aa, _ := a.Serialize() - ret = append(ret, aa...) - } - return ret - } - return bytes.Equal(pattrs(lhs.GetPathAttrs()), pattrs(rhs.GetPathAttrs())) - } - - if best != nil && old != nil && equal(best, old) { + if best != nil && best.Equal(old) { // RFC4684 3.2. Intra-AS VPN Route Distribution // When processing RT membership NLRIs received from internal iBGP // peers, it is necessary to consider all available iBGP paths for a |