Skip to content

Commit

Permalink
fix upstream/import-valid debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Nov 3, 2020
1 parent 1e5537a commit 3202afd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,19 @@ func main() {
// Update the "latest operation" timestamp
peerData.QueryTime = time.Now().Format(time.RFC1123)
} else if peerData.Type == "upstream" || peerData.Type == "import-valid" {

//Check if upstream has MaxPrefix4/6 set, if not set sensible defaults and if they are configured too low, warn the user
// Check if upstream has MaxPrefix4/6 set, if not set sensible defaults and if they are configured too low, warn the user
if peerData.ImportLimit4 == 0 {
peerData.ImportLimit4 = 1000000 // 1M routes
log.Infof("Upstream %s has no IPv4 import limit configured. Setting to 1000000", peerName)
log.Infof("Upstream/Import-Valid %s has no IPv4 import limit configured. Setting to 1000000", peerName)
} else if peerData.ImportLimit4 <= 900000 {
log.Infof("Upstream %s has a low IPv4 import limit configured. You may want to increase the MaxPrefix4 limit.", peerName)
log.Infof("Upstream/Import-Valid %s has a low IPv4 import limit configured. You may want to increase the MaxPrefix4 limit.", peerName)
}

if peerData.ImportLimit6 == 0 {
peerData.ImportLimit6 = 100000 // 100k routes
log.Infof("Upstream %s has no IPv6 import limit configured. Setting to 100000", peerName)
log.Infof("Upstream/Import-Valid %s has no IPv6 import limit configured. Setting to 100000", peerName)
} else if peerData.ImportLimit6 <= 98000 {
log.Infof("Upstream %s has a low IPv6 import limit configured. You may want to increase the MaxPrefix6 limit.", peerName)
log.Infof("Upstream/Import-Valid %s has a low IPv6 import limit configured. You may want to increase the MaxPrefix6 limit.", peerName)
}
}

Expand Down

0 comments on commit 3202afd

Please sign in to comment.