diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-09-08 10:57:43 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-09-08 13:13:34 +0900 |
commit | 9298e5eeca78e8bb02ff34b500add622b73b4f5f (patch) | |
tree | 857f7646d93ba770527e61edd76dd1838b440249 /table/table_manager.go | |
parent | 89b904b7417932e78c8c6fea2ad5d8a35891b0a4 (diff) |
*: kill bgp.NLRInfo and bgp.WithdrawnRoute
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 | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index 75b68b03..4477182b 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -29,11 +29,8 @@ func nlri2Path(m *bgp.BGPMessage, p *PeerInfo, now time.Time) []*Path { updateMsg := m.Body.(*bgp.BGPUpdate) pathAttributes := updateMsg.PathAttributes pathList := make([]*Path, 0) - for _, nlri_info := range updateMsg.NLRI { - // define local variable to pass nlri's address to CreatePath - var nlri bgp.NLRInfo = nlri_info - // create Path object - path := NewPath(p, &nlri, false, pathAttributes, false, now, false) + for _, nlri := range updateMsg.NLRI { + path := NewPath(p, nlri, false, pathAttributes, false, now, false) pathList = append(pathList, path) } return pathList @@ -43,11 +40,8 @@ func withdraw2Path(m *bgp.BGPMessage, p *PeerInfo, now time.Time) []*Path { updateMsg := m.Body.(*bgp.BGPUpdate) pathAttributes := updateMsg.PathAttributes pathList := make([]*Path, 0) - for _, nlriWithdraw := range updateMsg.WithdrawnRoutes { - // define local variable to pass nlri's address to CreatePath - var w bgp.WithdrawnRoute = nlriWithdraw - // create withdrawn Path object - path := NewPath(p, &w, true, pathAttributes, false, now, false) + for _, nlri := range updateMsg.WithdrawnRoutes { + path := NewPath(p, nlri, true, pathAttributes, false, now, false) pathList = append(pathList, path) } return pathList |