From 8ba70c4e515e4125a9d11996d2fa815bde31158d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 16 Jul 2019 20:24:26 -0400 Subject: [PATCH] zebra: Print out client who sent us bad data A client was sending zebra a route with no nexthops! Update the error message to tell us *Which* daemon is doing this. Signed-off-by: Donald Sharp --- zebra/zapi_msg.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 387c09be87..b6a8ee950c 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1431,12 +1431,10 @@ static void zread_route_add(ZAPI_HANDLER_ARGS) if (!CHECK_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP) || api.nexthop_num == 0) { - char buf_prefix[PREFIX_STRLEN]; - - prefix2str(&api.prefix, buf_prefix, sizeof(buf_prefix)); flog_warn(EC_ZEBRA_RX_ROUTE_NO_NEXTHOPS, - "%s: received a route without nexthops for prefix %s", - __func__, buf_prefix); + "%s: received a route without nexthops for prefix %pFX from client %s", + __func__, &api.prefix, + zebra_route_string(client->proto)); XFREE(MTYPE_RE, re); return; }