Remove debug logging for withdrawals without origin ASN
This commit is contained in:
parent
3c46087976
commit
eda90d96a9
@ -46,7 +46,7 @@ func New() (*Config, error) {
|
|||||||
return &Config{
|
return &Config{
|
||||||
StateDir: stateDir,
|
StateDir: stateDir,
|
||||||
MaxRuntime: 0, // Run forever by default
|
MaxRuntime: 0, // Run forever by default
|
||||||
EnableBatchedDatabaseWrites: true, // Enable batching by default
|
EnableBatchedDatabaseWrites: true, // Enable batching by default
|
||||||
RouteExpirationTimeout: defaultRouteExpirationMinutes * time.Minute, // For active route monitoring
|
RouteExpirationTimeout: defaultRouteExpirationMinutes * time.Minute, // For active route monitoring
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ const (
|
|||||||
|
|
||||||
// prefixBatchTimeout is the maximum time to wait before flushing a batch
|
// prefixBatchTimeout is the maximum time to wait before flushing a batch
|
||||||
prefixBatchTimeout = 5 * time.Second
|
prefixBatchTimeout = 5 * time.Second
|
||||||
|
|
||||||
// IP version constants
|
// IP version constants
|
||||||
ipv4Version = 4
|
ipv4Version = 4
|
||||||
ipv6Version = 6
|
ipv6Version = 6
|
||||||
@ -111,11 +111,11 @@ func (h *PrefixHandler) HandleMessage(msg *ristypes.RISMessage) {
|
|||||||
for _, prefix := range msg.Withdrawals {
|
for _, prefix := range msg.Withdrawals {
|
||||||
h.batch = append(h.batch, prefixUpdate{
|
h.batch = append(h.batch, prefixUpdate{
|
||||||
prefix: prefix,
|
prefix: prefix,
|
||||||
originASN: 0, // No origin for withdrawals
|
originASN: originASN, // Use the originASN from path if available
|
||||||
peer: msg.Peer,
|
peer: msg.Peer,
|
||||||
messageType: "withdrawal",
|
messageType: "withdrawal",
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
path: nil,
|
path: msg.Path,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ func parseCIDR(prefix string) (maskLength int, ipVersion int, err error) {
|
|||||||
if strings.Contains(prefix, ":") {
|
if strings.Contains(prefix, ":") {
|
||||||
return ones, ipv6Version, nil
|
return ones, ipv6Version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return ones, ipv4Version, nil
|
return ones, ipv4Version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,11 +255,14 @@ func (h *PrefixHandler) processWithdrawal(_ *database.Prefix, update prefixUpdat
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If no origin ASN, log a warning
|
// If no origin ASN, just delete all routes for this prefix from this peer
|
||||||
h.logger.Warn("Withdrawal without origin ASN",
|
if err := h.db.DeleteLiveRoute(update.prefix, 0, update.peer); err != nil {
|
||||||
"prefix", update.prefix,
|
h.logger.Error("Failed to delete live route (no origin ASN)",
|
||||||
"peer", update.peer,
|
"prefix", update.prefix,
|
||||||
)
|
"peer", update.peer,
|
||||||
|
"error", err,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user