summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2014-12-08 21:10:14 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2014-12-08 21:10:14 +0900
commit8e3d8c97b898efc6b88313ea8475c37cabaf8cfe (patch)
tree31fdb06dec1b58a051a9981156862e2a374f7275 /table/table.go
parentea42263b49d7dee42153d346172c1b275fc47b61 (diff)
[bestpath_selection] fix bugs when handling withdraw routes
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/table/table.go b/table/table.go
index 99c4de1f..c3339a9f 100644
--- a/table/table.go
+++ b/table/table.go
@@ -81,18 +81,17 @@ func insert(table Table, path Path) Destination {
return dest
}
func insertSentRoute(table Table, sentRoute *SentRoute) {
- pd := sentRoute.path.(*PathDefault)
+ pd := sentRoute.path
table.validatePath(pd)
dest := getOrCreateDest(table, pd.getNlri())
- dest.(*DestinationDefault).addSentRoute(sentRoute)
+ dest.addSentRoute(sentRoute)
}
//"Remove old paths from whose source is `peer`
func (td *TableDefault) cleanupPathsForPeer(peer *Peer) {
for _, dest := range td.destinations {
- dd := dest.(*DestinationDefault)
- pathsDeleted := dd.removeOldPathsFromSource(peer)
- hadSent := dd.removeSentRoute(peer)
+ pathsDeleted := dest.removeOldPathsFromSource(peer)
+ hadSent := dest.removeSentRoute(peer)
if hadSent {
logger.Errorf("Cleaning paths from table %s for peer %s.", td, peer)
}
@@ -119,7 +118,7 @@ func (td *TableDefault) cleanUninterestingPaths(interested_rts) int {
}
*/
-func deleteDestByNlri(table Table, nlri *bgp.NLRInfo) Destination {
+func deleteDestByNlri(table Table, nlri bgp.AddrPrefixInterface) Destination {
table.validateNlri(nlri)
destinations := table.getDestinations()
dest := destinations[table.tableKey(nlri).String()]