summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-04-08 20:05:37 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-07 21:18:04 +0900
commit957917651e48e552491d9a6272db296cb5c0a295 (patch)
tree52c4bdbafc749c4bfa8e3d59d171802c1341189c /server
parentee91af5b638755a19c6954579b77a28916fb9bff (diff)
table: remove withdraw/newPath/oldPath Lists in Destination
Shrink memory usage. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/server.go4
-rw-r--r--server/server_test.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/server.go b/server/server.go
index e766d84e..30fb9c22 100644
--- a/server/server.go
+++ b/server/server.go
@@ -701,7 +701,7 @@ func (server *BgpServer) dropPeerAllRoutes(peer *Peer, families []bgp.RouteFamil
}
}
-func dstsToPaths(id string, as uint32, dsts []*table.Destination) ([]*table.Path, []*table.Path, [][]*table.Path) {
+func dstsToPaths(id string, as uint32, dsts []*table.Update) ([]*table.Path, []*table.Path, [][]*table.Path) {
bestList := make([]*table.Path, 0, len(dsts))
oldList := make([]*table.Path, 0, len(dsts))
mpathList := make([][]*table.Path, 0, len(dsts))
@@ -717,7 +717,7 @@ func dstsToPaths(id string, as uint32, dsts []*table.Destination) ([]*table.Path
return bestList, oldList, mpathList
}
-func (server *BgpServer) propagateUpdateToNeighbors(source *Peer, newPath *table.Path, dsts []*table.Destination, needOld bool) {
+func (server *BgpServer) propagateUpdateToNeighbors(source *Peer, newPath *table.Path, dsts []*table.Update, needOld bool) {
if table.SelectionOptions.DisableBestPathSelection {
return
}
diff --git a/server/server_test.go b/server/server_test.go
index 720202d0..0bbd4070 100644
--- a/server/server_test.go
+++ b/server/server_test.go
@@ -269,7 +269,7 @@ func newPeerandInfo(myAs, as uint32, address string, rib *table.TableManager) (*
}
func process(rib *table.TableManager, l []*table.Path) (*table.Path, *table.Path) {
- dsts := make([]*table.Destination, 0)
+ dsts := make([]*table.Update, 0)
for _, path := range l {
dsts = append(dsts, rib.Update(path)...)
}