summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-28 14:28:00 -0700
committerPaul Jakma <paul@quagga.net>2009-06-18 20:18:27 +0100
commit81cce0185e23b6ecd2ab98ab34182901226bcf9e (patch)
tree24a8fa282d80b9dab623bb26fbbec731c0c8b34a /zebra/interface.c
parent82f5ee1ead0aa83f83f918abfc3f5071741a56e5 (diff)
downloadquagga-81cce0185e23b6ecd2ab98ab34182901226bcf9e.tar.bz2
quagga-81cce0185e23b6ecd2ab98ab34182901226bcf9e.tar.xz
[cleanup] Use correct buffer size for inet_ntop()
Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN) or IPv6 (INET6_ADDRSTRLEN) message.
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c4
1 files changed, 2 insertions, 2 deletions
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)