summaryrefslogtreecommitdiff
path: root/ospfd/ospf_zebra.c
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2020-07-30 19:22:34 +0800
committerAaron LI <aly@aaronly.me>2020-07-30 08:16:18 -0700
commit1a08238236242ad8f1a0d24592d9d76bdcf1fefe (patch)
tree2c3a8fe2cce3c59f8e16c88ad06504a2f6fc278f /ospfd/ospf_zebra.c
parent25ee44b52278c86fda27f76e932f6a12c375bf10 (diff)
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 <aly@aaronly.me>
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r--ospfd/ospf_zebra.c2
1 files changed, 1 insertions, 1 deletions
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);