diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-10-20 21:25:03 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-10-26 07:02:54 +0900 |
commit | 2e05695f683430bdf39573b19f51bac4dcbbc693 (patch) | |
tree | 3f80939fb737832dbf8f8f5ebe0b35e0e9900718 /internal/pkg/table/adj.go | |
parent | b4e2d9e440a4eb6d3091a7c586d2e55b69ec968a (diff) |
avoid installing routes with originator ID to global when softresetin
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'internal/pkg/table/adj.go')
-rw-r--r-- | internal/pkg/table/adj.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/pkg/table/adj.go b/internal/pkg/table/adj.go index 5dda2a29..aedc41d6 100644 --- a/internal/pkg/table/adj.go +++ b/internal/pkg/table/adj.go @@ -63,16 +63,16 @@ func (adj *AdjRib) Update(pathList []*Path) { if len(d.knownPathList) == 0 { t.deleteDest(d) } - if !old.IsAsLooped() { + if !old.IsRejected() { adj.accepted[rf]-- } } path.SetDropped(true) } else { if idx != -1 { - if old.IsAsLooped() && !path.IsAsLooped() { + if old.IsRejected() && !path.IsRejected() { adj.accepted[rf]++ - } else if !old.IsAsLooped() && path.IsAsLooped() { + } else if !old.IsRejected() && path.IsRejected() { adj.accepted[rf]-- } if old.Equal(path) { @@ -81,7 +81,7 @@ func (adj *AdjRib) Update(pathList []*Path) { d.knownPathList[idx] = path } else { d.knownPathList = append(d.knownPathList, path) - if !path.IsAsLooped() { + if !path.IsRejected() { adj.accepted[rf]++ } } @@ -121,7 +121,7 @@ func (adj *AdjRib) PathList(rfList []bgp.RouteFamily, accepted bool) []*Path { pathList := make([]*Path, 0, adj.Count(rfList)) adj.walk(rfList, func(d *Destination) bool { for _, p := range d.knownPathList { - if accepted && p.IsAsLooped() { + if accepted && p.IsRejected() { continue } pathList = append(pathList, p) @@ -189,9 +189,9 @@ func (adj *AdjRib) StaleAll(rfList []bgp.RouteFamily) []*Path { for i, p := range d.knownPathList { n := p.Clone(false) n.MarkStale(true) - n.SetAsLooped(p.IsAsLooped()) + n.SetRejected(p.IsRejected()) d.knownPathList[i] = n - if !n.IsAsLooped() { + if !n.IsRejected() { pathList = append(pathList, n) } } @@ -210,9 +210,9 @@ func (adj *AdjRib) MarkLLGRStaleOrDrop(rfList []bgp.RouteFamily) []*Path { pathList = append(pathList, n) } else { n := p.Clone(false) - n.SetAsLooped(p.IsAsLooped()) + n.SetRejected(p.IsRejected()) n.SetCommunities([]uint32{uint32(bgp.COMMUNITY_LLGR_STALE)}, false) - if p.IsAsLooped() { + if p.IsRejected() { d.knownPathList[i] = n } else { pathList = append(pathList, n) |