diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-02-01 22:46:33 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-02-01 23:11:12 +0900 |
commit | 21b7301e049dc1ac5128001e49ec1a2b194ead7b (patch) | |
tree | eeec9bec953df8e5bc2b92ee2fdcedad492a2646 /table/adj.go | |
parent | 2419b8add20024c3c90210a36cf208a8ef467a10 (diff) |
server: fix soft-reset-in to handle in-policy change properly
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/adj.go')
-rw-r--r-- | table/adj.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/table/adj.go b/table/adj.go index f7914557..65d9d161 100644 --- a/table/adj.go +++ b/table/adj.go @@ -75,6 +75,17 @@ func (adj *AdjRib) Update(pathList []*Path) { } } +func (adj *AdjRib) RefreshAcceptedNumber(rfList []bgp.RouteFamily) { + for _, rf := range rfList { + adj.accepted[rf] = 0 + for _, p := range adj.table[rf] { + if p.Filtered(adj.id) != POLICY_DIRECTION_IN { + adj.accepted[rf]++ + } + } + } +} + func (adj *AdjRib) PathList(rfList []bgp.RouteFamily, accepted bool) []*Path { pathList := make([]*Path, 0, adj.Count(rfList)) for _, rf := range rfList { |