From 81cce0185e23b6ecd2ab98ab34182901226bcf9e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 28 Apr 2009 14:28:00 -0700 Subject: [cleanup] Use correct buffer size for inet_ntop() Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN) or IPv6 (INET6_ADDRSTRLEN) message. --- zebra/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 9cbbf937..3e4867c4 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1513,7 +1513,6 @@ if_config_write (struct vty *vty) { struct listnode *node; struct interface *ifp; - char buf[BUFSIZ]; for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) { @@ -1543,10 +1542,11 @@ if_config_write (struct vty *vty) { 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) -- cgit v1.2.1