summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 10:50:26 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 10:50:26 +0900
commit59f18c15ca7f809376d73a412b0d6351298b66fd (patch)
treef56aba1d039e3205984834f34ce5ebf4156d7f8f /table/table_manager.go
parente2fdf3c3684434a92d46ecbfe9a5ba6f3ef0e587 (diff)
use the same timestamp for bmp and mrt updates
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r--table/table_manager.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/table/table_manager.go b/table/table_manager.go
index 4cb196a1..03d8ed83 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -96,13 +96,12 @@ func mpunreachNlri2Path(m *bgp.BGPMessage, p *PeerInfo, now time.Time) []*Path {
return pathList
}
-func ProcessMessage(m *bgp.BGPMessage, peerInfo *PeerInfo) []*Path {
+func ProcessMessage(m *bgp.BGPMessage, peerInfo *PeerInfo, timestamp time.Time) []*Path {
pathList := make([]*Path, 0)
- now := time.Now()
- pathList = append(pathList, nlri2Path(m, peerInfo, now)...)
- pathList = append(pathList, withdraw2Path(m, peerInfo, now)...)
- pathList = append(pathList, mpreachNlri2Path(m, peerInfo, now)...)
- pathList = append(pathList, mpunreachNlri2Path(m, peerInfo, now)...)
+ pathList = append(pathList, nlri2Path(m, peerInfo, timestamp)...)
+ pathList = append(pathList, withdraw2Path(m, peerInfo, timestamp)...)
+ pathList = append(pathList, mpreachNlri2Path(m, peerInfo, timestamp)...)
+ pathList = append(pathList, mpunreachNlri2Path(m, peerInfo, timestamp)...)
return pathList
}
@@ -505,7 +504,7 @@ func (manager *TableManager) ProcessUpdate(fromPeer *PeerInfo, message *bgp.BGPM
return []*Path{}, nil
}
- return manager.ProcessPaths(ProcessMessage(message, fromPeer))
+ return manager.ProcessPaths(ProcessMessage(message, fromPeer, time.Now()))
}
type AdjRib struct {