diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-04-10 15:38:46 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-04-15 05:31:40 +0000 |
commit | d405c203ad8070298f256856605edb6d5480ba04 (patch) | |
tree | dccd1bf4ba74abf95d9606dcafb8f3422979e708 /table/table_manager.go | |
parent | a6efaf6ed6baf26050090b400310196464bab06f (diff) |
table: sort peers/routes at client side instead of bgpd side
peer/route sorting is for pretty priting. do it at the client side.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index 679b684c..df89a2eb 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -18,7 +18,6 @@ package table import ( log "github.com/Sirupsen/logrus" "github.com/osrg/gobgp/packet" - "github.com/tchap/go-patricia/patricia" "reflect" "time" ) @@ -341,18 +340,10 @@ func (adj *AdjRib) UpdateOut(pathList []Path) { } func (adj *AdjRib) getPathList(rib map[string]*ReceivedRoute) []Path { - trie := patricia.NewTrie() + pathList := make([]Path, 0, len(rib)) for _, rr := range rib { - key := rr.path.GetNlri().String() - trie.Insert(cidr2prefix(key), rr.path) + pathList = append(pathList, rr.path) } - - pathList := []Path{} - trie.Visit(func(prefix patricia.Prefix, item patricia.Item) error { - path, _ := item.(Path) - pathList = append(pathList, path) - return nil - }) return pathList } |