From: Donald Sharp Date: Tue, 6 Jun 2017 14:17:06 +0000 (-0400) Subject: zebra: Remove strcpy from fast path X-Git-Tag: frr-4.0-dev~468^2~62 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7649a4f60ca5022a6a056432d62b6a59263b9703;p=mirror%2Ffrr.git zebra: Remove strcpy from fast path Signed-off-by: Donald Sharp --- diff --git a/zebra/zebra_mroute.c b/zebra/zebra_mroute.c index c00498171d..6b510f9d3b 100644 --- a/zebra/zebra_mroute.c +++ b/zebra/zebra_mroute.c @@ -30,6 +30,7 @@ #include "zebra/zebra_vrf.h" #include "zebra/zebra_mroute.h" #include "zebra/rt.h" +#include "zebra/debug.h" int zebra_ipmr_route_stats(struct zserv *client, int fd, u_short length, struct zebra_vrf *zvrf) @@ -38,16 +39,20 @@ int zebra_ipmr_route_stats(struct zserv *client, int fd, u_short length, struct stream *s; int suc; - char sbuf[40]; - char gbuf[40]; - memset(&mroute, 0, sizeof(mroute)); stream_get(&mroute.sg.src, client->ibuf, 4); stream_get(&mroute.sg.grp, client->ibuf, 4); mroute.ifindex = stream_getl(client->ibuf); - strcpy(sbuf, inet_ntoa(mroute.sg.src)); - strcpy(gbuf, inet_ntoa(mroute.sg.grp)); + if (IS_ZEBRA_DEBUG_KERNEL) { + char sbuf[40]; + char gbuf[40]; + + strcpy(sbuf, inet_ntoa(mroute.sg.src)); + strcpy(gbuf, inet_ntoa(mroute.sg.grp)); + + zlog_debug("Asking for (%s,%s) mroute information", sbuf, gbuf); + } suc = kernel_get_ipmr_sg_stats(&mroute);