[cleanup] Use correct buffer size for inet_ntop()
Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN)
or IPv6 (INET6_ADDRSTRLEN) message.
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index b7bd567..a8107ae 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -369,13 +369,14 @@
struct listnode *node, *nnode;
struct zserv *client;
struct prefix *p;
- char buf[BUFSIZ];
if (IS_ZEBRA_DEBUG_EVENT)
{
+ char buf[INET6_ADDRSTRLEN];
+
p = ifc->address;
zlog_debug ("MESSAGE: ZEBRA_INTERFACE_ADDRESS_ADD %s/%d on %s",
- inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
+ inet_ntop (p->family, &p->u.prefix, buf, INET6_ADDRSTRLEN),
p->prefixlen, ifc->ifp->name);
}
@@ -394,13 +395,14 @@
struct listnode *node, *nnode;
struct zserv *client;
struct prefix *p;
- char buf[BUFSIZ];
if (IS_ZEBRA_DEBUG_EVENT)
{
+ char buf[INET6_ADDRSTRLEN];
+
p = ifc->address;
zlog_debug ("MESSAGE: ZEBRA_INTERFACE_ADDRESS_DELETE %s/%d on %s",
- inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
+ inet_ntop (p->family, &p->u.prefix, buf, INET6_ADDRSTRLEN),
p->prefixlen, ifc->ifp->name);
}