From: Donald Sharp Date: Thu, 12 May 2016 01:31:30 +0000 (-0400) Subject: Fix unprotected debugs to warns and fix X-Git-Tag: frr-2.0-rc1~921 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fb02523bf3b39a3d6195db5d2a6d4794e76afa8e;p=matthieu%2Ffrr.git 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 --- 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); } }