From 6d24b7cc08d6c95a538415bdc58614c076f1f9a7 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 21 Nov 2019 19:41:48 -0500 Subject: [PATCH] bgpd: Prevent possible SA thinking we'll divide by zero The half and reuse variables can never be 1 but the SA systems we have do not know this and think it is possible. Provide the kick in the snarples that the SA needs to know this is not true. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fb2eb10dd9..48bf255994 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12183,6 +12183,12 @@ DEFUN (bgp_damp_set, max = 4 * half; } + /* + * These can't be 0 but our SA doesn't understand the + * way our cli is constructed + */ + assert(reuse); + assert(half); if (suppress < reuse) { vty_out(vty, "Suppress value cannot be less than reuse value \n"); -- 2.39.5