From fb02523bf3b39a3d6195db5d2a6d4794e76afa8e Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 11 May 2016 21:31:30 -0400 Subject: [PATCH] Fix unprotected debugs to warns and fix In the case of a route replace failing we saw two issues with the logging: 1) The route replace was a debug instead of a warn -> In this case change code to zlog_warn 2) The buf in the route replace was not being initialized because buf initialization was protected by a debug check. -> In this case move the buf initialization to inside the failure case. Signed-off-by: Donald Sharp Reviewed-by: Daniel Walton Reviewed-by: Vivek Venkatraman --- zebra/zebra_rib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index f4dbb3877d..7430532364 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1307,8 +1307,9 @@ rib_process_add_route (struct zebra_vrf *zvrf, struct route_node *rn, if (rib_install_kernel (rn, select, 0)) { installed = 0; - zlog_debug ("%u:%s/%d: Route install failed", - zvrf->vrf_id, buf, rn->p.prefixlen); + inet_ntop (rn->p.family, &rn->p.u.prefix, buf, INET6_ADDRSTRLEN); + zlog_warn ("%u:%s/%d: Route install failed", + zvrf->vrf_id, buf, rn->p.prefixlen); } } @@ -1393,8 +1394,9 @@ rib_process_update_route (struct zebra_vrf *zvrf, struct route_node *rn, if (rib_install_kernel (rn, select, 1)) { installed = 0; - zlog_debug ("%u:%s/%d: Route install failed", - zvrf->vrf_id, buf, rn->p.prefixlen); + inet_ntop (rn->p.family, &rn->p.u.prefix, buf, INET6_ADDRSTRLEN); + zlog_warn ("%u:%s/%d: Route install failed", + zvrf->vrf_id, buf, rn->p.prefixlen); } } -- 2.39.5