]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Fix Zebra route add message truncation issue 6824/head
authorAaron LI <aly@aaronly.me>
Thu, 30 Jul 2020 11:22:34 +0000 (19:22 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 30 Jul 2020 15:16:18 +0000 (08:16 -0700)
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>
ospfd/ospf_zebra.c

index e04eb539d80303f0ff5d7ce906a141c871609409..84bdb9ec5b2f2cc7ef150afcaa058d09a7fa36e5 100644 (file)
@@ -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);