Skip to content

Commit

Permalink
Another badly named function. CountVRPs does not return the number
Browse files Browse the repository at this point in the history
of VRPs but the number of objects in the cache.
  • Loading branch information
cjeker committed Dec 21, 2023
1 parent 2f8e5b6 commit d1f8fb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/stayrtr/stayrtr.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ func (s *state) reloadFromCurrentState() error {
}

vrps, brks, vaps, count, countv4, countv6 := processData(vrpsjson, bgpsecjson, aspajson)
if s.server.CountVRPs() != count {
log.Infof("New update to old state (%v uniques, %v total prefixes). (old %v - new %v)", len(vrps), count, s.server.CountVRPs(), count)
if s.server.CountSDs() != count {
log.Infof("New update to old state (%v uniques, %v total prefixes). (old %v - new %v)", len(vrps), count, s.server.CountSDs(), count)
return s.applyUpdateFromNewState(vrps, brks, vaps, sessid, vrpsjson, bgpsecjson, aspajson, countv4, countv6)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion lib/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (s *Server) SetSerial(serial uint32) {
s.setSerial(serial)
}

func (s *Server) CountVRPs() int {
func (s *Server) CountSDs() int {
s.sdlock.RLock()
defer s.sdlock.RUnlock()

Expand Down

0 comments on commit d1f8fb2

Please sign in to comment.