From e2eff5c3b13ee31ddc1b80d828ce12fba64f6a3b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 25 Feb 2022 08:19:07 -0500 Subject: lib: Add a Dev catch for when a timer is set for > 1 year Since there are timers that are created based upon doing some math and we know that unsigned values when doing math and we accidently subtract a larger number from a smaller number causes the unsigned number to wrap to very large numbers, let's put in a small catch in place to see if there are any places in the system that mistakes are made and FRR is accidently creating a problem for itself. Signed-off-by: Donald Sharp --- lib/lib_errors.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib_errors.c') diff --git a/lib/lib_errors.c b/lib/lib_errors.c index acc9a05c33..a658e4c295 100644 --- a/lib/lib_errors.c +++ b/lib/lib_errors.c @@ -68,6 +68,12 @@ static struct log_ref ferr_lib_warn[] = { .description = "The Event subsystem has detected a file descriptor read/write event without an associated handling function. This is a bug, please collect log data and open an issue.", .suggestion = "Gather log data and open an Issue", }, + { + .code = EC_LIB_TIMER_TOO_LONG, + .title = "The Event subsystem has detected an internal timer that is scheduled to pop in greater than one year", + .description = "The Event subsystem has detected a timer being started that will pop in a timer that is greater than one year. This is a bug, please collect log data and open an issue.", + .suggestion = "Gather log data and open an Issue", + }, { .code = EC_LIB_RMAP_RECURSION_LIMIT, .title = "Reached the Route-Map Recursion Limit", -- cgit v1.2.3