From 1a08238236242ad8f1a0d24592d9d76bdcf1fefe Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 30 Jul 2020 19:22:34 +0800 Subject: [PATCH] ospfd: Fix Zebra route add message truncation issue The `INET_ADDRSTRLEN` is 16 and is only enough to format an IPv4 address. So when there is a prefix (`/xx`), the debug output may get truncated. Use `PREFIX2STR_BUFFER` macro instead to fix the issue. Signed-off-by: Aaron LI --- ospfd/ospf_zebra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index e04eb539d8..84bdb9ec5b 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -276,7 +276,7 @@ void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *p, count++; if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) { - char buf[2][INET_ADDRSTRLEN]; + char buf[2][PREFIX2STR_BUFFER]; struct interface *ifp; ifp = if_lookup_by_index(path->ifindex, ospf->vrf_id);