summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-21 10:10:17 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-21 10:10:17 +0900
commit0e64f7c080fafb61dd97023bb25e0c59b53b7556 (patch)
treea473434c09fefa27cd9c4a80018841cd3afcc4f1 /server
parenta1a86cd2127cd30c7781563ac8e00257f1214779 (diff)
server: remove peer's getBests method
Use TableManager's getBestPathList Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/peer.go12
-rw-r--r--server/server.go2
2 files changed, 2 insertions, 12 deletions
diff --git a/server/peer.go b/server/peer.go
index ea1d8098..55240cf6 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -124,7 +124,7 @@ func (peer *Peer) getAccepted(rfList []bgp.RouteFamily) []*table.Path {
}
func (peer *Peer) getBestFromLocal() ([]*table.Path, []*table.Path) {
- pathList, filtered := peer.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(peer, peer.getBests(peer.localRib)))
+ pathList, filtered := peer.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(peer, peer.localRib.GetBestPathList(peer.localRib.GetRFlist())))
if peer.isRouteServerClient() == false {
for _, path := range pathList {
path.UpdatePathAttrs(&peer.gConf, &peer.conf)
@@ -249,16 +249,6 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*b
return pathList, update, bgpMsgList
}
-func (peer *Peer) getBests(rib *table.TableManager) []*table.Path {
- pathList := []*table.Path{}
- for _, rf := range peer.configuredRFlist() {
- for _, paths := range rib.GetBestPathList(rf) {
- pathList = append(pathList, paths)
- }
- }
- return pathList
-}
-
func (peer *Peer) startFSMHandler(incoming chan *fsmMsg) {
peer.fsm.h = NewFSMHandler(peer.fsm, incoming, peer.outgoing)
}
diff --git a/server/server.go b/server/server.go
index 417d09d7..5f6ec58a 100644
--- a/server/server.go
+++ b/server/server.go
@@ -1124,7 +1124,7 @@ func (server *BgpServer) handleModPathRequest(grpcReq *GrpcRequest) []*table.Pat
macIpAdv := evpnNlri.RouteTypeData.(*bgp.EVPNMacIPAdvertisementRoute)
etag := macIpAdv.ETag
mac := macIpAdv.MacAddress
- paths := server.globalRib.GetBestPathList(bgp.RF_EVPN)
+ paths := server.globalRib.GetBestPathList([]bgp.RouteFamily{bgp.RF_EVPN})
if m := getMacMobilityExtendedCommunity(etag, mac, paths); m != nil {
extcomms = append(extcomms, m)
}