From 7649a4f60ca5022a6a056432d62b6a59263b9703 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 6 Jun 2017 10:17:06 -0400 Subject: [PATCH] zebra: Remove strcpy from fast path Signed-off-by: Donald Sharp --- zebra/zebra_mroute.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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); -- 2.39.5