diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-28 15:12:20 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-29 22:50:40 +0900 |
commit | 53f7e5add711efa58771030443bf3faa9f9e244d (patch) | |
tree | 69edc2e42f8cffd4e79a84c5686e5da8442f023f /table/table_manager.go | |
parent | 4f3f0468a1d32e3dc1a18d18601c4c9867e4f377 (diff) |
Revert "table: increase the possibiliby of many NLRIs in one update message"
This reverts commit 51494759aded7098e151869e66dd5b2c4d96ecfd.
gobgpd still sends too more updates rather than Quagga. Revert this.
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index 6943101c..75b68b03 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -22,7 +22,6 @@ import ( "github.com/osrg/gobgp/packet" "net" "reflect" - "sort" "time" ) @@ -357,45 +356,16 @@ func (manager *TableManager) GetPathList(rf bgp.RouteFamily) []*Path { return paths } -type paths []*Path - -func (p paths) Len() int { - return len(p) -} - -func (p paths) Swap(i, j int) { - p[i], p[j] = p[j], p[i] -} - -func (p paths) Less(i, j int) bool { - l0 := len(p[i].GetPathAttrs()) - l1 := len(p[j].GetPathAttrs()) - if l0 < l1 { - return true - } - if l0 == l1 { - return p[i].GetAsPathLen() < p[j].GetAsPathLen() - } - return false -} - func (manager *TableManager) GetBestPathList(rf bgp.RouteFamily) []*Path { if _, ok := manager.Tables[rf]; !ok { return []*Path{} } destinations := manager.Tables[rf].GetDestinations() - plist := make([]*Path, 0, len(destinations)) - pathsByPeer := make(map[uint32]paths) + paths := make([]*Path, 0, len(destinations)) for _, dest := range destinations { - path := dest.GetBestPath() - key := path.GetSourceAs() - pathsByPeer[key] = append(pathsByPeer[key], path) - } - for _, v := range pathsByPeer { - sort.Sort(v) - plist = append(plist, v...) + paths = append(paths, dest.GetBestPath()) } - return plist + return paths } // process BGPUpdate message |