[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/interface.c b/zebra/interface.c
index 9cbbf93..3e4867c 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1513,7 +1513,6 @@
{
struct listnode *node;
struct interface *ifp;
- char buf[BUFSIZ];
for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
{
@@ -1543,10 +1542,11 @@
{
if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
{
+ char buf[INET6_ADDRSTRLEN];
p = ifc->address;
vty_out (vty, " ip%s address %s/%d",
p->family == AF_INET ? "" : "v6",
- inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
+ inet_ntop (p->family, &p->u.prefix, buf, sizeof(buf)),
p->prefixlen);
if (ifc->label)